Underground disease detection system and detection method based on YOLOv8n
By improving the backbone network and loss function of the YOLOv8n model, the noise interference and false detection and missed detection problems of ground penetrating radar in underground disease detection are solved, achieving more efficient and accurate underground disease detection.
Patent Information
- Application Number
- CN202510961422.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-14
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-07-14
AI Technical Summary
The existing deep learning-based ground-penetrating radar suffers from severe background noise interference in underground disease detection, leading to problems such as false detection and missed detection. In addition, the model's adaptability and detection speed in complex environments need to be improved.
The backbone network of the YOLOv8n model is improved by introducing the GhostConv-C2f module, the CBAM module, and the SPPF module. Combined with the A-CIoU loss function, the feature extraction and loss function are optimized to enhance the model's ability to detect underground diseases.
The model's detection speed and accuracy have been improved, its adaptability and stability to complex environments have been enhanced, and it can better identify underground diseases of different sizes.
Smart Images

Figure CN120495282B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of underground disease detection using ground penetrating radar, and in particular to an underground disease detection system and method based on YOLOv8n. Background Art
[0002] As urban road construction shifts from high-speed to high-quality, road inspection is increasingly becoming non-destructive and intelligent. Ground Penetrating Radar (GPR), a mature and advanced non-destructive testing method, integrated with deep learning technology can effectively improve the efficiency and accuracy of road inspection, and has demonstrated outstanding application value in the field.
[0003] GPR technology mainly relies on the propagation and reflection characteristics of electromagnetic waves in different media to detect underground targets; its operating mechanism is: first, high-frequency electromagnetic waves are emitted into the underground, and then the signals reflected from interfaces with different electromagnetic properties are collected. It can be used to detect various underground objects, such as pipelines, cavities, etc. The signals received by GPR are digitally processed to form radar images, but the complexity of the underground environment will cause the images to contain a lot of noise and interference signals, and large-scale detection will generate massive amounts of data. Manual analysis alone is inefficient and prone to misidentification. Therefore, a more efficient way is needed to interpret GPR data to improve the efficiency and accuracy of judging underground media.
[0004] In order to give full play to the advantages of GPR in underground detection, data processing technology can be combined with GPR. Early radar data processing used edge detection, threshold processing and other methods, but edge detection requires clear images, and threshold processing requires manual parameter adjustment, which has many uncontrollable factors; and machine learning, as a type of artificial intelligence technology, has data analysis and self-learning capabilities. Scholars have applied machine learning to GPR image processing. Traditional GPR image machine learning detection methods include generalized Hough transform, support vector machine, clustering algorithm and BP network, etc. However, these methods require manual adjustment of features, poor generalization performance and other disadvantages, and are difficult to fit the complex and diverse actual measurement scenarios with changing conditions.
[0005] In recent years, deep learning has developed rapidly, and its image processing advantages are outstanding. Therefore, scholars have applied it to GPR image data analysis and processing. Deep learning methods can autonomously iterate and update processed data, have strong environmental adaptability, and are suitable for GPR image detection in complex environments. Among them, Liu et al. combined the YOLO series with 3D GPR images and selected the performance-balanced YOLOv5 model to improve the detection efficiency of internal defects in asphalt pavements. They also evaluated the benefits of maintenance programs from economic and environmental perspectives, which can reduce maintenance costs, energy consumption, and carbon emissions. However, it is only applicable to asphalt pavements and has not been verified for detection effects on other types of pavements, limiting its versatility. Qiao et al. designed a GPR road anomaly interpretation system based on the YOLO algorithm. The system uses GPR field measurement images as input, combines image and video processing technology with the YOLOv8n convolutional neural network model to interpret anomaly targets, with an average recall rate of 91.0% and an average precision of 91.6%. A visualization interface was designed using the Streamlit Web App framework. However, this study only focused on road anomaly detection, with a relatively single application scenario, and did not investigate the model's application in complex geological conditions or different types of GPR. proposed a domain adaptation YOLO network (DA-YOLO) based on generative adversarial networks, which improved the detection performance of the network on real data by aligning the feature distribution of simulated and real GPR data, and further optimized the network by using a pseudo-label training strategy. This method was effective in tunnel lining delamination detection experiments, with the recall rate, precision, F1 score and average precision reaching 81.25%, 86.67%, 83.87% and 69.30% on real data, respectively. However, the model construction and training process are complex and require high computing resources. Yang et al. proposed a GPR image recognition network GPR-YOLOv5 based on YOLOv5 and ConvNeXt, replacing the backbone network CSPDarknet of YOLOv5 with ConvNeXt to enhance the recognition performance of small targets. When detecting underground pipe corridors, cavities, galvanized water pipes and PVC pipes, the network's recognition accuracy, average precision and F1 value reached 93.21% and 92.46% respectively. and 91.25%, which are better than the YOLOv4 and YOLOv5 models, but the real-time speed processing of the model has not been fully verified, and there may be stability issues when facing complex environments.
[0006] According to the above research, the current ground penetrating radar based on deep learning still has serious background noise interference when detecting underground media, resulting in false detection, missed detection, etc. This application intends to improve the detection speed and accuracy of the model by improving YOLOv8n, optimizing the backbone network, adding attention mechanism and loss function optimization. After detailed search, no relevant technical solutions were found. Summary of the Invention
[0007] The present application provides an underground disease detection system based on YOLOv8n, comprising: a backbone network, a neck network, a head network, and a loss function, wherein the backbone network comprises a Conv module, a Conv module, a GhostConv-C2f module, a CBAM module, a Conv module, a GhostConv-C2f module, a CBAM module, and an SPPF module connected in sequence;
[0008] Conv module: The input image first enters the Conv module, which performs convolution operations on the image using convolution kernels of different sizes and strides to preliminarily extract basic features related to underground targets from the original radar echo image;
[0009] GhostConv-C2f module: First, a normal convolution is performed using 50%-75% of the original convolution kernel to obtain the basic feature map, and then a 1×1 convolution is performed to generate a ghost feature map, and the two are concatenated as the output;
[0010] CBAM module: The feature map processed by the GhostConv-C2f module enters the CBAM module. The CBAM module optimizes features from both channel and spatial aspects, generates weights through global pooling and MLP, and enhances key channel features;
[0011] SPPF module: performs pooling operations at different scales on the input feature map, fuses multi-scale features, and improves the model's adaptability and stability to changes in target scale.
[0012] As a preferred solution, the loss function adopts the A-CIoU loss function.
[0013] As a preferred solution, the Conv module includes a Conv2d module, a Batch Norm2d module, and a SiLU module connected in sequence.
[0014] As a preferred solution, the GhostConv-C2f module includes a GhostConv module, a Split module, a Bottleneck module, a Bottleneck module, a Concat module, and a GhostConv module connected in sequence.
[0015] As a preferred solution, the SPPF module includes a Conv module, a MaxPool2d module, a MaxPool2d module, a MaxPool2d module, a Concat module, and a Conv module connected in sequence.
[0016] A method for detecting underground diseases based on YOLOv8n, comprising the following steps:
[0017] S1: The images collected by the ground penetrating radar are preprocessed and used as model input;
[0018] S2: The Conv module performs preliminary extraction on the image, and the GhostConv-C2f module performs optimized extraction on the image after preliminary extraction;
[0019] S3: The feature map processed by the GhostConv-C2f module enters the CBAM module, which optimizes features from both channel and spatial perspectives. The SPPF module performs pooling operations at different scales on the input feature map processed by the CBAM module, fusing multi-scale features to improve the model's adaptability and stability to target scale changes.
[0020] S4: The neck network aggregates feature maps from different stages of the backbone network to construct a feature pyramid, splicing or fusing features of different scales and integrating contextual information to ensure that the network can detect underground disease objects of different sizes;
[0021] S5: The head network outputs the detection target.
[0022] As a preferred solution, S6 is also included: using the A-CIoU loss function to optimize training.
[0023] As an optimal solution, the A-CIoU loss function introduces a scale adjustment factor to adjust the scales of the predicted box and the true box coordinates; the weights are dynamically adjusted by calculating the standard deviation of the feature map, and the loss function is minimized by continuously adjusting the parameters to improve detection accuracy.
[0024] As an optimal solution, the calculation method of the scale adjustment factor is introduced: let the coordinates of the prediction box B be , real frame The coordinates are ;
[0025] Adjusted prediction box The coordinates are , the adjusted ground truth box The coordinates are , represents the scale adjustment factor;
[0026] By calculating the standard deviation of the feature map To dynamically adjust the calculation method of the weight of the loss function:
[0027] Let the feature map be , and its standard deviation is , dynamic weight It can be expressed as:
[0028] in, is the average of the standard deviations of all feature maps;
[0029] The calculation formula of the A-CIoU loss function is as follows:
[0030] in, is the dynamic weight; is the scale adjustment factor The intersection-over-union (IoU) of the adjusted predicted box and the true box; is the scale adjustment factor The square of the Euclidean distance between the center point of the adjusted prediction box and the true box; is the scale adjustment factor The diagonal length of the smallest rectangle that can contain both the predicted box and the true box after adjustment; is the weight used to balance the aspect ratio term; is the scale adjustment factor Additional measure of aspect ratio consistency after adjustment.
[0031] As a preferred solution, the specific algorithm of S2 is as follows:
[0032] Input feature map , ,in, is the number of input channels, and are the height and width of the feature map, respectively, using convolution kernels Perform ordinary convolution operation to obtain the basic feature map after convolution operation , , and Represent the height and width of the feature map after convolution operation respectively; The calculation formula is: ;in, represents convolution, is the convolution kernel size; for each output channel , For the basic feature map , to generate Phantom feature map, let ghost feature map It is obtained by linear transformation of the basic feature map using a 1×1 convolution kernel. Transform, set is the final number of output channels required ( ), then for :
[0033] in, Represents 1×1 convolution;
[0034] The basic feature map and ghost feature maps Splice together to get the final output feature map , .
[0035] As a preferred solution, the channel attention mechanism in S3 generates weights through global pooling and MLP to enhance key channel features; the spatial attention mechanism generates weights through pooling and convolution to highlight the characteristics of the spatial area where the target is located and suppress noise and irrelevant information.
[0036] This application uses the GhostConv-C2f module to improve model efficiency while ensuring feature expression capabilities, providing more efficient features for subsequent detection; the CBAM module optimizes features from both channel and spatial aspects, and the channel attention mechanism generates weights through global pooling and MLP to enhance key channel features. The spatial attention mechanism generates weights through pooling and convolution to highlight the characteristics of the spatial area where the target is located and suppress noise and irrelevant information; the SPPF module performs pooling operations at different scales on the input feature map, integrates multi-scale features, and improves the model's adaptability and stability to changes in target scale, allowing the model to better identify underground diseases of different sizes; thus, this application can improve the detection speed and accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 This is the logic diagram of this application;
[0038] Figure 2 A schematic diagram of the backbone network of this application;
[0039] Figure 3 Schematic diagram of the GhostConv_C2f module of this application;
[0040] Figure 4 This is a schematic diagram of the Conv module of this application;
[0041] Figure 5 A schematic diagram of the SPPF module of this application;
[0042] Figure 6 The logic of the CBAM module of this application;
[0043] Figure 7 This is the result of YOLOv8n underground pipeline recognition;
[0044] Figure 8 Results of implementing the six-step model for underground pipeline identification;
[0045] Figure 9This is the result of YOLOv8n hole recognition;
[0046] Figure 10 Results of implementing the six-step model for void identification; DETAILED DESCRIPTION
[0047] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. It should be noted that the specific embodiments described herein are only used to illustrate and explain the present invention and are not used to limit the present invention. Example 1
[0048] This application provides a YOLOv8n-based underground disease detection system, including:
[0049] Backbone network: Extracts features from the input image and converts the original image into a feature map containing rich information, providing necessary input for the subsequent neck network and head network. In the underground detection task of GPR images, the features extracted by the backbone network directly affect the subsequent recognition and positioning accuracy of defects.
[0050] Neck network: It acts as a bridge connecting the backbone network and the head network, integrating contextual information through feature fusion. Contextual information refers to information about the surrounding environment, background, and other related elements related to the target object or area of interest. In this application, it may include the scene around the target object, the existence of other related objects and their mutual relationships, etc. It mainly constructs a feature pyramid by aggregating feature maps from different stages of the backbone network, and splicing or fusing features of different scales to ensure that the network can detect objects of different sizes.
[0051] Head network: The part responsible for generating network outputs, including generating bounding boxes related to possible objects in the image, assigning a confidence score to each bounding box to indicate the possibility of the object's existence, and classifying objects in the bounding box; the head network adopts the design concept of a decoupled head to separate the classification and regression tasks, allowing the model to focus on target category prediction and position positioning respectively, thereby improving detection accuracy; the classification branch is responsible for predicting the target category. It processes the input feature map through a series of convolutional layers and finally outputs the probability of each category corresponding to each prediction box; the role of the regression branch is to estimate the specific position and actual size of the target. It outputs the coordinates of the prediction box and continuously optimizes these coordinates so that the prediction box can accurately frame the target.
[0052] Loss function: It is an important indicator for comprehensively evaluating the degree of deviation between the prediction results output by the model and the true label. It consists of three parts: classification loss, bounding box regression loss, and distribution focal loss. , which can optimize the model from different angles and improve the accuracy and effect of target detection; preferably, A-CIoU is used as the loss function so that the model can more accurately learn the features of targets of different scales.
[0053] In the object detection task, the original CIoU loss function is a key indicator used to accurately measure the degree of deviation between the predicted box and the true box. Based on IoU, it further considers the consistency of the distance, overlapping area, and aspect ratio between the predicted box and the true box. Its formula is:
[0054] in, It is the intersection-over-union ratio of the predicted box and the true box, reflecting the degree of overlap between the two; It is the square of the Euclidean distance between the center point of the predicted box and the true box, which is used to measure the distance between the two; It is the diagonal length of the smallest rectangle that can contain both the predicted box and the real box, which is used to normalize the distance; is the weight used to balance the aspect ratio term; It is an additional term to measure the consistency of aspect ratio, which is reflected by calculating the difference between the aspect ratios of the predicted box and the real box.
[0055] The scale and distribution of features in the model of this application will change after operations such as GhostConv-C2f are combined, and the CIoU loss function has some limitations and does not fully consider these changes; when calculating parameters such as the intersection-over-union ratio and the center point distance, the CIoU loss function is based on the original coordinate and scale information and is not adjusted according to the changes in features. This may make the loss function unable to accurately reflect the difference between the predicted box and the real box in the feature space after GhostConv-C2f. To solve this problem, this application designs the A-CIoU loss function, which is optimized by introducing a scale adjustment factor and dynamic weight adjustment.
[0056] Introducing a scale adjustment factor: Considering the impact of GhostConv-C2f on the feature scale, A-CIoU introduces a scale adjustment factor ; When calculating parameters such as the intersection-over-union ratio, center point distance, and diagonal length, the coordinates of the predicted box and the true box are scaled, and the coordinates of the predicted box B are set to , real frame The coordinates are , adjusted prediction box The coordinates are , the adjusted real frame The coordinates are In this way, the loss function can better adapt to the changes in feature scale and more accurately measure the difference between the predicted box and the real box in the feature space after GhostConv-C2f.
[0057] Dynamic weight adjustment: A-CIoU is calculated by calculating the standard deviation of the feature map To dynamically adjust the weight of the loss function, the standard deviation reflects the distribution of features. When the standard deviation is large, it means that the distribution of features is more dispersed. At this time, the weight of the loss function needs to be increased to enable the model to better learn these features. On the contrary, when the standard deviation is small, it means that the distribution of features is more concentrated, and the weight of the loss function can be appropriately reduced. Let the feature mapping be , and its standard deviation is , dynamic weight It can be expressed as: in, is the average of the standard deviations of all feature maps.
[0058] In summary, the calculation formula of the A-CIoU loss function is as follows:
[0059] in, is the dynamic weight; Yes, after scaling factor The intersection-over-union (IoU) of the adjusted predicted box and the true box; is the scale adjustment factor The square of the Euclidean distance between the center point of the adjusted prediction box and the true box; is the scale adjustment factor The diagonal length of the smallest rectangle that can contain both the predicted box and the true box after adjustment; is the weight used to balance the aspect ratio term; is the scale adjustment factor An additional measure of aspect ratio consistency after adjustment, calculated based on the adjusted coordinates.
[0060] Among them, the backbone network includes a Conv module, a Conv module, a GhostConv-C2f module, a CBAM module, a Conv module, a GhostConv-C2f module, a CBAM module, and an SPPF module connected in sequence;
[0061] Conv module: It is one of the core components of the backbone network. It performs convolution operations on the input image through convolution kernels of different sizes and convolution steps to extract image features. When processing GPR images, the convolution layer can extract features related to underground targets, such as underground cavities and pipelines, from the original radar echo images.
[0062] GhostConv-C2f module: Optimizes the extracted features and generates a large number of feature maps through a small number of ordinary convolution operations, reducing the amount of computation. It first uses a small number of convolution kernels to perform ordinary convolution to obtain the basic feature map. Specifically, the small number of convolution kernels is 50%-75% of the original convolution kernel. It then generates a ghost feature map through 1×1 convolution and splices the two as output. While ensuring the feature expression ability, it improves model efficiency and provides more efficient features for subsequent detection.
[0063] CBAM module: Features are enhanced through the attention mechanism. The feature map processed by the GhostConv-C2f module enters the CBAM module, which optimizes features from both channel and spatial aspects. The channel attention mechanism generates weights through global pooling and MLP to enhance key channel features. The spatial attention mechanism generates weights through pooling and convolution to highlight the characteristics of the spatial area where the target is located and suppress noise and irrelevant information.
[0064] GPR data contains complex underground structure information, in which underground target features are easily obscured by noise and background clutter. The attention mechanism can help the model accurately identify and highlight weak features related to underground targets, while effectively suppressing noise and irrelevant background information, improving the accuracy and reliability of target detection. The CBAM module has a relatively simple structure and operates on the simplified feature map of GhostConv-C2f. The computational complexity is controllable, and it can efficiently optimize features from the channel and spatial dimensions. While ensuring computational efficiency, it effectively enhances the GhostConv-C2f features, improves the overall performance of the model, and meets the real-time and accuracy requirements of GPR.
[0065] SPPF module: It is used to achieve the fusion of multi-scale features. By performing pooling operations at different scales, the input feature map is pooled at multiple scale levels, and then these pooling results from different scales are integrated, thereby effectively improving the model's adaptability and stability to changes in target scale.
[0066] When applying YOLOv8n to GPR detection tasks, the improvement of the backbone network in this application can significantly enhance the model's ability to extract GPR image features, thereby improving detection performance. GPR detection involves a large amount of data processing, which consumes a large amount of computing resources. The core idea of GhostConv is to generate a large number of feature maps through a small number of ordinary convolution operations to reduce unnecessary calculations. Therefore, part of C2f can be introduced into the GhostConv operator to form GhostConv-C2f. In addition, in order to highlight features related to underground targets and suppress background noise, the CBAM attention mechanism is introduced to perform channel and spatial attention weighting on the extracted feature maps. Example 2
[0067] This embodiment specifically describes the Conv module, GhostConv-C2f module, and SPPF module. Specifically:
[0068] The Conv module includes a Conv2d module, a Batch Norm2d module, and a SiLU module connected in sequence.
[0069] Conv2d module: Extracts local image features (such as edges and textures) through convolution kernels. Convolution kernels of different sizes capture information at different scales, identify the basic outlines of underground targets in GPR images, and provide basic features for subsequent processing.
[0070] Batch Norm2d module: Standardizes feature maps and adjusts data distribution to a mean of 0 and a variance of 1. This accelerates training convergence, suppresses noise fluctuations caused by differences in GPR detection environments, and enhances model stability.
[0071] SiLU module: The SiLU activation function is applied to introduce nonlinearity, retain small gradients on the negative semi-axis, avoid gradient vanishing, and retain the characteristic response of weak targets in GPR images.
[0072] Through the above combination, the Conv2d module captures multi-scale spatial features, the BatchNorm2d module suppresses environmental noise and accelerates convergence, and the SiLU module retains weak target responses. The three are combined to generate high-quality feature maps. Based on the characteristics of GPR images, they effectively extract underground target features while suppressing background clutter. This provides high-quality input for the subsequent GhostConv-C2f module and SPPF module, laying the foundation for lightweight and high-precision.
[0073] The GhostConv-C2f module includes a GhostConv module, a Split module, a Bottleneck module, a Concat module, and a GhostConv module connected in sequence.
[0074] GhostConv module: Generates basic features through a small number of convolution kernels, and then generates ghost features through 1×1 convolution, reducing the amount of calculation and improving model efficiency while ensuring feature expression.
[0075] Split module: Splits the feature map output by the GhostConv module into two paths along the channel, diverting the Bottleneck module to enhance feature diversity.
[0076] Bottleneck module: It adopts the residual structure of "dimensionality reduction-convolution-dimensionality increase" to extract features through 1×1 and 3×3 convolutions. The residual connection retains the original information and alleviates the gradient disappearance.
[0077] Bottleneck module: Same as the Bottleneck module above, no further details are given.
[0078] Concat module: fuses the features after two-way Bottleneck processing, restores the number of channels, integrates multi-path features, and enhances the ability to express complex features.
[0079] GhostConv module: further integrates the concatenated features to generate lightweight output, keeping the number of channels unchanged while reducing computational cost.
[0080] Through the above combination, the GhostConv module realizes lightweight feature generation, the Split module and the Concat module construct multi-path feature fusion, and the Bottleneck module enhances expression through the residual structure. While significantly reducing the amount of calculation as a whole, it retains the feature details of underground targets, suppresses noise interference, and improves the model's ability to extract complex features from GPR images, adapting to the real-time detection needs of portable devices.
[0081] The SPPF module includes a Conv module, a MaxPool2d module, a MaxPool2d module, a MaxPool2d module, a Concat module, and a Conv module connected in sequence.
[0082] Conv module: Integrates channel information through 1×1 convolution, reduces the dimensionality of input features, reduces the amount of subsequent calculations, prepares for multi-scale pooling, and improves feature expression efficiency.
[0083] MaxPool2d module (level 1): Applies 5×5 max pooling to capture larger-scale contextual information, such as the overall outline of underground targets, enhancing the model's perception of large targets.
[0084] MaxPool2d module (level 2): Pools the first-level pooling results again, expanding the receptive field to 9×9, extracting more macroscopic global features, such as stratigraphic structures, to improve the overall understanding of the scene.
[0085] MaxPool2d module (three-level): further expands the receptive field to 13×13, captures super-scale context, such as large holes in deep layers, and enhances the model's adaptability to objects of different depths.
[0086] Concat module: concatenates the original features with the three-level pooling results, fuses multi-scale feature information, forms a pyramid representation, and improves the model's ability to detect objects of different sizes.
[0087] Conv module: Integrates high-dimensional features through 1×1 convolution, compresses the number of channels to the original level, reduces redundancy, integrates multi-scale information, and generates the final output features.
[0088] Through the above combination, three-level parallel pooling captures features from local to global perspectives, combines them with original features to form a pyramid representation, and enhances the model's ability to detect underground targets of different sizes (such as pipelines and cavities). The Concat module integrates multi-scale information and outputs Conv compressed features. This improves the model's responsiveness to multi-scale targets without increasing complexity, making it particularly suitable for scenarios where underground targets in GPR images vary greatly in size. Example 3
[0089] This embodiment provides a method for detecting underground diseases based on YOLOv8n, including the following steps:
[0090] S1: The images collected by the ground penetrating radar are preprocessed and used as model input;
[0091] Data sources include simulated radar images generated by GprMax numerical simulation software and images collected from actual engineering surveys. The simulated or directly collected raw data images often contain various noises and interferences. Directly using them as model inputs may affect the accuracy and performance of the model. Preprocessing can improve image quality, better highlight effective information, and make them more suitable as model inputs. Preprocessing includes but is not limited to the following methods:
[0092] Removing the mean: There may be some DC offsets in the ground penetrating radar data that are irrelevant to the target information. Removing the mean can make the data more focused on reflecting the changes in the electromagnetic characteristics of the target.
[0093] Filtering processing: Low-pass filtering can remove high-frequency noise, smooth the image, and make the details in the image clearer. High-frequency electromagnetic interference and other noise may be introduced during the ground penetrating radar acquisition process. Low-pass filtering can retain the effective low-frequency signals and remove the interference of high-frequency noise; high-pass filtering is used to enhance the edge and detail information in the image and highlight the difference between the target and the background. When detecting targets such as underground pipelines, high-pass filtering can make the boundary of the pipeline more obvious, facilitating subsequent identification and analysis; band-pass filtering combines the characteristics of low-pass and high-pass filtering, and only allows signals within a specific frequency range to pass, further improving the signal quality and signal-to-noise ratio; by selecting a suitable passband range, noise can be effectively suppressed while retaining the characteristic frequency signals related to the target.
[0094] Gain adjustment: Since ground penetrating radar signals will attenuate during propagation, the signal strength at different depths may vary greatly. Gain adjustment can amplify the signals at different depths according to the signal attenuation law, so that the target information at different depths in the image can be properly displayed, which is convenient for observation and analysis.
[0095] Background removal: Background information in ground-penetrating radar images may interfere with target recognition. By estimating and removing the background through certain algorithms, target features can be highlighted. For example, methods such as polynomial fitting can be used to estimate background trends and then subtract the background from the original data, making the target more prominent in the image and improving target detection accuracy.
[0096] Data normalization: Mapping data to a specific range, such as [0, 1] or [-1, 1], can make data with different features have the same scale, avoiding excessive or insufficient impact on model training due to excessively large or small values of certain features, which helps improve the convergence speed and stability of the model.
[0097] Image enhancement: Some image enhancement techniques, such as histogram equalization, are used to improve the contrast and visual effects of the image, making the targets in the image easier to identify and analyze. Histogram equalization can adjust the grayscale distribution of the image to make the grayscale of the image more evenly distributed, thereby enhancing the overall contrast of the image.
[0098] GprMax is an open-source electromagnetic simulation software that uses a finite-difference time-domain algorithm and is primarily used for ground-penetrating radar forward modeling. GprMax can simulate the propagation of electromagnetic waves in complex media, including underground layered media and targets. By inputting information such as the electromagnetic parameters, geometry, and antenna characteristics of the medium, GprMax can generate corresponding radar images. The actual engineering survey was based on a municipal road, using Reflexw software to perform denoising processing on the original image, including DC drift removal, background removal, and sliding averaging, to improve image quality.
[0099] The above images are divided into training set, validation set and test set, and the annotations are generated by Labelme using rectangular boxes to generate JSON format files for training the model.
[0100] S2: The Conv module performs preliminary extraction on the image, and the GhostConv-C2f module performs optimized extraction on the image after preliminary extraction;
[0101] The input image first enters the Conv module, which performs convolution operations on the image using convolution kernels of different sizes and strides to extract basic features related to underground targets from the original radar echo image, such as preliminary features of underground cavities, pipelines, and other targets;
[0102] GhostConv—C2f module optimization extraction: GhostConv generates a large number of feature maps through a small number of ordinary convolution operations, reducing the amount of computation. It first uses a small number of convolution kernels to perform ordinary convolution to obtain the basic feature map, and then generates a ghost feature map through 1×1 convolution, and splices the two as the output. While ensuring the feature expression capability, it improves model efficiency and provides more efficient features for subsequent detection.
[0103] S3: The feature map processed by GhostConv-C2f enters the CBAM module. The CBAM module optimizes features from both channel and spatial aspects. The channel attention mechanism generates weights through global pooling and MLP to enhance key channel features. The spatial attention mechanism generates weights through pooling and convolution to highlight the characteristics of the spatial area where the target is located and suppress noise and irrelevant information. The SPPF module performs pooling operations of different scales on the input feature map processed by the CBAM module, integrates multi-scale features, improves the model's adaptability and stability to changes in target scale, and enables the model to better identify underground diseases of different sizes.
[0104] S4: The neck network aggregates feature maps from different stages of the backbone network to construct a feature pyramid, splicing or fusing features of different scales and integrating contextual information to ensure that the network can detect underground disease objects of different sizes;
[0105] S5: The head network outputs the detected target. The head network adopts a decoupled head design. The classification branch processes the input feature map through the convolution layer, predicts the target category, and outputs the probability of each category corresponding to each prediction box. The regression branch estimates the target position and size, outputs the prediction box coordinates, and continuously optimizes the coordinates so that the prediction box accurately frames the underground disease target. Example 4
[0106] This embodiment also includes S6: using the A-CIoU loss function to optimize training; considering the impact of GhostConv on the feature scale, A-CIoU introduces a scale adjustment factor to adjust the scale of the predicted box and the real box coordinates to more accurately measure the feature space difference; dynamically adjust the weight by calculating the standard deviation of the feature map, increase the weight when the standard deviation is large to encourage the model to learn dispersed features, and reduce the weight when the standard deviation is small. The model minimizes the loss function by continuously adjusting parameters to improve detection accuracy.
[0107] In object detection tasks, the CIoU loss function is a key metric used to accurately measure the degree of deviation between the predicted box and the ground-truth box. This embodiment further considers the consistency of the distance, overlap area, and aspect ratio between the predicted box and the ground-truth box based on IoU.
[0108] The formula is:
[0109] in, It is the intersection-over-union ratio of the predicted box and the true box, reflecting the degree of overlap between the two; It is the square of the Euclidean distance between the center point of the predicted box and the true box, which is used to measure the distance between the two; It is the diagonal length of the smallest rectangle that can contain both the predicted box and the real box, which is used to normalize the distance; is the weight used to balance the aspect ratio term; It is an additional term to measure the consistency of aspect ratio, which is reflected by calculating the difference between the aspect ratios of the predicted box and the real box.
[0110] After combining this model with operations such as GhostConv, the scale and distribution of features will change, but the CIoU loss function has some limitations and does not fully consider these changes. When calculating parameters such as the intersection-over-union ratio and center point distance, CIoU is based on the original coordinate and scale information and is not adjusted according to the changes in features. This may make the loss function unable to accurately reflect the difference between the predicted box and the true box in the feature space after GhostConv. This embodiment proposes the A-CIoU loss function, which is optimized by introducing a scale adjustment factor and dynamic weight adjustment.
[0111] Introducing a scale adjustment factor: Considering the impact of GhostConv on feature scale, A-CIoU introduces a scale adjustment factor When calculating parameters such as the intersection-over-union ratio, center point distance, and diagonal length, the coordinates of the predicted box and the true box are scaled:
[0112] Let the coordinates of the prediction box B be , real frame The coordinates are ;
[0113] Adjusted prediction box The coordinates are , the adjusted ground truth box The coordinates are , represents the scale adjustment factor;
[0114] Dynamic weight adjustment: A-CIoU is calculated by calculating the standard deviation of the feature map To dynamically adjust the weight of the loss function, the standard deviation reflects the distribution of features. When the standard deviation is large, it means that the distribution of features is more dispersed. At this time, the weight of the loss function needs to be increased to enable the model to better learn these features. On the contrary, when the standard deviation is small, it means that the distribution of features is more concentrated, and the weight of the loss function can be appropriately reduced. Let the feature mapping be , and its standard deviation is , dynamic weight It can be expressed as:
[0115] in, is the average of the standard deviations of all feature maps;
[0116] The calculation formula of the A-CIoU loss function is as follows:
[0117] in, is the dynamic weight; is the scale adjustment factor The intersection-over-union (IoU) of the adjusted predicted box and the true box; is the scale adjustment factor The square of the Euclidean distance between the center point of the adjusted prediction box and the true box; is the scale adjustment factor The diagonal length of the smallest rectangle that can contain both the predicted box and the true box after adjustment; is the weight used to balance the aspect ratio term; is the scale adjustment factor Additional measure of aspect ratio consistency after adjustment. Example 5
[0118] The specific algorithm of S2 is as follows:
[0119] Deep convolutional neural networks often play a key role in processing GPR data and performing related tasks of target recognition, and are widely used in feature extraction and target classification. However, traditional convolution operations have a large amount of computation and parameters, which leads to slow model training and inference speeds and high requirements on hardware resources. Therefore, a new convolution operator, GhostConv, is introduced into the YOLOv8n backbone network. This operation can reduce the amount of computation and parameters while preserving the model's feature expression ability as much as possible. GhostConv reduces the computational complexity of convolution operations by reducing the number of basic convolution kernels (from n to m). At the same time, the ghost feature map is generated by a simple 1×1 convolution, which has a relatively low computational complexity. Therefore, GhostConv can significantly reduce the computational overhead and parameter amount of the entire network, improve the inference speed of the model, and make it more suitable for running on resource-constrained devices.
[0120] The specific algorithm is: Input feature map , ,in, is the number of input channels, and are the height and width of the feature map, respectively, using convolution kernels Perform ordinary convolution operation to obtain the basic feature map after convolution operation , , and Represent the height and width of the feature map after convolution operation respectively; The calculation formula is: ;in, represents convolution, is the convolution kernel size; for each output channel , For the basic feature map , to generate Phantom feature map, let ghost feature map It is obtained by linear transformation of the basic feature map using a 1×1 convolution kernel. Transform, set is the final number of output channels required ( ), then for :
[0121] in, Represents 1×1 convolution;
[0122] The basic feature map and ghost feature maps Splice together to get the final output feature map , . Example 6
[0123] This example provides an explanation of a specific experiment and experimental results:
[0124] 1. Experimental environment and sample dataset.
[0125] The specific configuration environment of this experiment is: the system is Ubuntu 20.04, the processor is Intel Core i7-12700K, the graphics card is NVIDIA GeForce RTX 3090, the memory is 32GB DDR4, the development tool and development language are PyTorch 1.12.0 and Python3.8 respectively.
[0126] The sample data sets come from two sources: simulations based on GprMax numerical simulation software and actual engineering exploration;
[0127] In this embodiment, GprMax is used to perform modeling and forward simulation based on relevant data, and finally 300 simulated radar images are obtained, including 100 normal types, 100 pipeline types, and 100 cavity types. The actual engineering detection is based on a 10 km municipal road. Reflexw software is used to perform denoising processing such as DC drift removal, background removal, and sliding average on the original images to improve image quality, and remove images that do not meet the requirements. A total of 700 qualified images are obtained, including 400 normal types, 148 pipeline types, and 152 cavity types.
[0128] After the dataset is prepared, the entire dataset is divided into training set, validation set, and test set in a ratio of 7:2:1. The dataset is annotated using Labelme, with rectangular boxes used for annotation, and a JSON format annotation file is generated. The training process is set to 1000 rounds.
[0129] 2. Model performance and evaluation indicators.
[0130] In this experiment, four evaluation indicators were selected to evaluate the detection results, namely, Average Percision (AP), Precision (P), Recall (R), and Floating-Point Operations Per Second (GFLOPS).
[0131] (1) Precision: This is used to consider the proportion of samples that are actually positive examples among all samples determined by the model to be positive examples. The calculation formula is as follows:
[0132] in, represents the true positive examples, that is, the number of samples correctly predicted by the model as positive examples; represents false positives, that is, the number of samples that the model incorrectly predicts as positive.
[0133] (2) Recall rate: It is used to measure the proportion of samples that are accurately identified as positive examples in the actual positive sample set. It reflects the model's ability to fully retrieve all positive examples and intuitively reflects the model's capture coverage of positive examples. The formula is as follows:
[0134] in, represents false negatives, that is, the number of samples that are actually positive but are incorrectly predicted as negative by the model.
[0135] (3) Average Precision: refers to the average of the precision rates at different recall levels. It evaluates the overall performance of the model under different recall conditions by calculating the area covered by the precision-recall curve (PR curve). The formula is as follows:
[0136] in, is the recall rate, is the accuracy after interpolation.
[0137] (4) Computational cost: It is an important indicator to measure the complexity of the model. It refers to the number of floating-point operations performed by the model in a single forward propagation. It is generally measured in floating-point operations per second (GFLOPS). This indicator can intuitively reflect the computational complexity of the model and help evaluate the model's demand for computing resources and operating efficiency.
[0138] For an input feature map with size , the convolution kernel size is , the number of output feature map channels is , the step size is , filled with The computational cost (number of floating-point operations) of the convolutional layer is:
[0139] in, , , the total number of floating-point operations calculated is divided by the execution time and converted to GFLOPS ( ) floating-point operations.
[0140] 3. Comparative experiment.
[0141] In order to verify the effectiveness and accuracy of the proposed algorithm in GPR target detection, a performance test was conducted on the self-built GPR dataset and compared with the results of the YOLOv8n model. The results are as follows Figure 7-10 As shown in the actual recognition images, the proposed model achieved confidence levels of 0.93 and 0.86 for underground pipelines and cavities, respectively, compared to 0.85 and 0.78 for the original YOLOv8n model. In the YOLO object detection algorithm, confidence levels are used to assess the model's confidence in the presence of the target object within the prediction box and the accuracy of the prediction box's position. The higher confidence levels of the proposed model compared to the original YOLOv8n model indicate its greater reliability in identifying underground hazards.
[0142] The experimental results show that both the proposed model and the original YOLOv8n model can detect underground targets. The proposed model can more accurately distinguish between various types of targets, indicating that the proposed model can complete detection more comprehensively and accurately.
[0143] In order to further verify the detection advantage of this model, the same training parameters are set and the results of this model are compared with those of YOLOv5n, YOLOv7-tiny, YOLOv8n and SSD models. The results are shown in Table 1:
[0144]
[0145] Table 1 Comparative experimental results
[0146] From the data in Table 1, we can see that compared with other detection versions, the model of this application performs better in accuracy, recall rate, and average precision, and has less computational complexity.
[0147] Specifically, the model of this application has an accuracy of 93.1%, which is higher than other models, indicating that the model is more accurate in predicting positive examples, with fewer cases of misclassification as positive examples, and has better performance for tasks that require accurate identification of positive examples; the recall rate is 88.4%, slightly higher than YOLOv8n's 87.6%, and significantly higher than YOLOv7-tin's 82.5%, YOLOv5n's 78.5% and SSD's 76.5%; this shows that this model has a stronger ability to capture true positive samples and a lower probability of missing positive examples; the average precision is the core indicator for evaluating the performance of the target detection model. The AP value of this model reaches 90.7%, which fully demonstrates its excellent comprehensive performance. It can maintain high precision at different recall rates and can identify targets more stably and accurately in target detection tasks.
[0148] The floating-point operations of this model are 8.2 GFLOPs, which is higher than SSD's 7.8 GFLOPs, much lower than YOLOv7-tin's 13.5 GFLOPs and YOLOv5n's 15.6 GFLOPs, and lower than YOLOv8n's 8.6 GFLOPs. This shows that this model is more efficient in computing resource utilization. While maintaining high performance, it has relatively low demand for computing resources, making it more suitable for use in devices with limited computing resources or scenarios with high real-time requirements.
[0149] 4. Ablation experiment.
[0150] To verify the impact of the improved modules proposed in this model on overall detection performance, we conducted five sets of ablation experiments on the dataset of this article based on the YOLOv8n model, introducing the GhostConv operator, the CBAM attention mechanism, and the A-CIoU loss function optimization. The results are shown in Table 2:
[0151]
[0152] Table 2 Ablation experiment
[0153] As can be seen from Table 2, the P, R, AP and GFLOPs of Experiment 1 are 92.3%, 87.6%, 89.9% and 8.6 respectively; compared with Experiment 1, Experiment 2 introduces the GhostConv operator, and P is reduced to 90.5%, R is reduced to 86.2%, AP is reduced to 88.4%, and GFLOPs is reduced to 8.3, indicating that the GhostConv operator can effectively reduce the amount of model calculation, but will reduce the detection accuracy to a certain extent; Experiment 3 introduces the attention mechanism CBAM on the basis of Experiment 2. Compared with Experiment 2, P is increased to 91.2%, R is increased to 86.5%, AP is increased to 88.5%, and GFLOPs is increased to 8.5, which shows that the introduction of the attention mechanism CBAM effectively focuses the model's attention on the target area and improves the detection accuracy of the model, but it will also increase the amount of calculation to a certain extent; Experiment 4 is based on Experiment 2. Based on this, the A-CIoU loss function optimization was introduced. Compared with Experiment 2, P was improved to 92.5%, R was improved to 87.8, AP was improved to 89.6, and GFLOPs was improved to 8.4. This shows that the introduction of A-CIoU enables this model to better adapt to feature changes and improve target detection performance; Experiment 5 is a comprehensive application of the GhostConv operator, CBAM attention mechanism and A-CIoU loss function optimization. Compared with Experiment 1, P was improved to 93.1%, R was improved to 88.4%, AP was improved to 90.7, and GFLOPs was reduced to 8.2. This shows that through a series of improvement measures, the model detection accuracy can be improved while reducing the amount of calculation; this ablation experiment fully proves that the introduction of the GhostConv operator, CBAM attention mechanism and A-CIoU loss function optimization can effectively improve the performance in GPR image detection.
[0154] In view of the difficulties faced by GPR image detection such as poor accuracy and lack of computing resources, this application constructs an optimization model based on YOLOv8n; this model first introduces the GhostConv operator to reduce the amount of calculation and thus improve the model's computing speed; secondly, the CBAM attention mechanism is introduced to suppress background noise and irrelevant information, allowing the model to adaptively focus on the key information in the input data; in order to further enhance the model's adaptability to dynamic changes in features, the A-CIoU loss function is finally introduced to promote a step-by-step improvement in the model's detection accuracy; after the improvement, the model's P is 93.1%, R is 88.4%, and AP is 90.7, which are 0.8%, 0.8%, and 0.8% higher than the original YOLOv8n, respectively, and the number of floating-point operations is reduced by 0.4, which can meet the needs of users on portable devices.
[0155] In this experiment, in order to address the shortcomings of experimental data, GprMax was used to simulate the data and integrate it with the measured data to form a new data set, thereby improving the experimental data sample set and enhancing the versatility of the model to a certain extent.
[0156] This model can consider the identification of other underground targets and further reduce the computational workload through model tailoring, so that it can be applied to mobile devices with less computing resources, thereby reducing the hardware cost of GPR and achieving more extensive real-time detection.
[0157] To sum up, due to the adoption of the above-mentioned technical solutions, this application improves the model efficiency while ensuring the feature expression ability through the GhostConv-C2f module, providing more efficient features for subsequent detection; the CBAM module optimizes features from both channel and spatial aspects, and the channel attention mechanism generates weights through global pooling and MLP to enhance key channel features. The spatial attention mechanism generates weights through pooling and convolution to highlight the characteristics of the spatial area where the target is located and suppress noise and irrelevant information; the SPPF module performs pooling operations at different scales on the input feature map, integrates multi-scale features, and improves the model's adaptability and stability to changes in target scale, so that the model can better identify underground diseases of different sizes; thus, this application can improve the detection speed and accuracy of the model.
[0158] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes 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 apparatus. In the absence of further restrictions, an element defined by the sentence "includes a..." does not exclude the presence of other identical elements in the process, method, article or apparatus that includes the element.
[0159] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are protected by this application.
Claims
1. A YOLOv8n-based underground disease detection system, comprising: A backbone network, a neck network, a head network, and a loss function, wherein the backbone network includes a Conv module, a Conv module, a GhostConv-C2f module, a CBAM module, a Conv module, a GhostConv-C2f module, a CBAM module, and an SPPF module connected in sequence; Conv module: The input image first enters the Conv module, which performs convolution operations on the image using convolution kernels of different sizes and strides to preliminarily extract basic features related to underground targets from the original radar echo image; GhostConv-C2f module: First, a normal convolution is performed using 50%-75% of the original convolution kernel to obtain a basic feature map, and then a 1×1 convolution is performed to generate a ghost feature map, and the two are concatenated as the output; the GhostConv-C2f module includes a GhostConv module, a Split module, a Bottleneck module, a Bottleneck module, a Concat module, and a GhostConv module connected in sequence; CBAM module: The feature map processed by the GhostConv-C2f module enters the CBAM module, which optimizes features from both channel and spatial aspects; SPPF module: performs pooling operations at different scales on the input feature map, fuses multi-scale features, and improves the model's adaptability and stability to changes in target scale.
2. The underground disease detection system based on YOLOv8n according to claim 1 is characterized in that: The loss function adopts A-CIoU loss function.
3. The underground disease detection system based on YOLOv8n according to claim 1 is characterized in that: The Conv module includes a Conv2d module, a Batch Norm2d module, and a SiLU module connected in sequence.
4. The underground disease detection system based on YOLOv8n according to claim 1, characterized in that: The SPPF module includes a Conv module, a MaxPool2d module, a Concat module, and a Conv module connected in sequence.
5. The underground disease detection method based on the YOLOv8n underground disease detection system according to any one of claims 1 to 4, characterized in that: The steps include: S1: The images collected by the ground penetrating radar are preprocessed and used as model input; S2: The Conv module performs preliminary extraction on the image, and the GhostConv-C2f module performs optimized extraction on the image after preliminary extraction; S3: The feature map processed by the GhostConv-C2f module enters the CBAM module, which optimizes the features from both channel and spatial aspects; The SPPF module performs pooling operations at different scales on the input feature maps processed by the CBAM module, fusing multi-scale features to improve the model's adaptability and stability to target scale changes. S4: The neck network aggregates feature maps from different stages of the backbone network to construct a feature pyramid, splicing or fusing features of different scales and integrating contextual information to ensure that the network can detect underground disease objects of different sizes; S5: The head network outputs the detection target.
6. The underground disease detection method based on YOLOv8n according to claim 5, characterized in that: Also includes S6: using A-CIoU loss function to optimize training.
7. The underground disease detection method based on YOLOv8n according to claim 6, characterized in that: The A-CIoU loss function introduces a scale adjustment factor to adjust the scale of the predicted box and the real box coordinates; the weight is dynamically adjusted by calculating the standard deviation of the feature map, and the loss function is minimized by continuously adjusting the parameters to improve the detection accuracy.
8. The underground disease detection method based on YOLOv8n according to claim 7 is characterized in that: The calculation method of introducing the scale adjustment factor: Let the coordinates of the prediction box B be , real frame The coordinates are ; Adjusted prediction box The coordinates are , the adjusted ground truth box The coordinates are , represents the scale adjustment factor; Calculate the standard deviation of the feature map To dynamically adjust the calculation method of the loss function weight: Let the feature map be , and its standard deviation is , dynamic weight Expressed as: in, is the average of the standard deviations of all feature maps; The calculation formula of the A-CIoU loss function is as follows: in, is the dynamic weight; is the scale adjustment factor The intersection-over-union (IoU) of the adjusted predicted box and the true box; is the scale adjustment factor The square of the Euclidean distance between the center point of the adjusted prediction box and the true box; is the scale adjustment factor The diagonal length of the smallest rectangle that can contain both the predicted box and the true box after adjustment; is the weight used to balance the aspect ratio term; is the scale adjustment factor Additional measure of aspect ratio consistency after adjustment.
9. The underground disease detection method based on YOLOv8n according to claim 5, characterized in that: The specific algorithm of S2 is as follows: Input feature map , ,in, is the number of input channels, and are the height and width of the feature map, respectively, using convolution kernels Perform ordinary convolution operation to obtain the basic feature map after convolution operation , , and Represent the height and width of the feature map after convolution operation respectively; The calculation formula is: ;in, represents convolution, is the convolution kernel size; for each output channel , For the basic feature map , to generate Phantom feature map, let ghost feature map It is obtained by linear transformation of the basic feature map using a 1×1 convolution kernel. Transform, set is the final number of output channels required, , then for : in, Represents 1×1 convolution; The basic feature map and ghost feature maps Splice together to get the final output feature map , .
Citation Information
Patent Citations
Mechanical arm 6D pose grabbing method based on neural network
CN117315025A
Plant disease detection method based on improved YOLOv8n network
CN120164113A