Multi-type pipeline disease detection method and system based on improved YOLOv8
By introducing the improved YOLOv8 method of dynamic convolution, BiFPN and SEAM attention modules in pipeline disease detection, the problems of low detection accuracy and relying on manual judgment in the prior art are solved, and higher disease detection accuracy and model performance are achieved.
Patent Information
- Application Number
- CN202411694045.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-14
AI Technical Summary
When detecting drainage pipe diseases, the prior art has problems such as low detection accuracy, relying on manual judgment, time-consuming and labor-consuming, and easy to cause missed inspections.
Various types of pipeline disease detection methods based on improved YOLOv8 are adopted, and dynamic convolution is introduced into the backbone feature extraction network, BiFPN structure is adopted at the neck of the model, and SEAM attention module is introduced deep to enhance the disease area detection capability in the image.
It effectively improves the detection accuracy of occlusion diseases and smaller target diseases, improves model performance and generalization capabilities, and reduces dependence on manual judgment.
Smart Images

Figure CN119625399A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine vision technology, and in particular to a method and system for detecting multiple types of pipeline defects based on improved YOLOv8. Background Art
[0002] Drainage pipes are affected by structural deterioration and dynamic changes in the environment, and they are inevitably prone to damage, blockage, deformation and other problems. At present, drainage pipes are usually inspected by collecting images or videos through pipeline closed-circuit televisions, and pipeline defects are detected by manual identification methods. This method relies on the subjective judgment of professionals, which is not only time-consuming and labor-intensive, but may also cause missed detections and false detections, reducing the detection accuracy. In order to achieve automatic recognition of pipeline defects, traditional image processing is applied to detection, such as threshold segmentation algorithms, Canny edge detection algorithms, support vector machines, random forest algorithms, etc. However, traditional image processing algorithms usually require manual design of features and rules. These features and rules are often targeted at specific application scenarios. In new or changing environments, traditional methods may not work effectively. In recent years, deep learning has achieved good results in various computer vision tasks and solved the shortcomings of traditional image processing methods, but current methods still have the problem of low detection accuracy. Summary of the invention
[0003] In order to overcome the above problems or at least partially solve the above problems, the present invention provides a method and system for detecting multiple types of pipeline defects based on improved YOLOv8, which can effectively improve the detection accuracy of occluded defects and smaller target defects.
[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0005] In a first aspect, the present invention provides a method for detecting multiple types of pipeline defects based on improved YOLOv8, comprising the following steps:
[0006] Based on YOLOv8, dynamic convolution is introduced in the backbone feature extraction network to dynamically aggregate multiple convolution kernels according to the degree of attention paid to each input to build an initial detection model;
[0007] The BiFPN structure is used in the neck of the initial detection model, and the SEAM attention module is introduced in the deep layer of the initial detection model to enhance the defect area in the image to build the target pipeline defect detection model;
[0008] Pipeline diseases are detected based on the target pipeline disease detection model. The backbone feature extraction network based on the target pipeline disease detection model extracts key features from the input pipeline image through convolution operations. The neck network uses the feature pyramid network to fuse the extracted image features, and generates anchor frames containing feature maps through the prediction head. For each anchor frame, the target pipeline disease detection model predicts its corresponding category probability and outputs the probability distribution of each anchor frame belonging to each category, thereby realizing the detection of multiple types of diseases.
[0009] Taking into account the fact that pipeline diseases are of many types and various forms, the present invention first introduces dynamic convolution in the backbone feature extraction network. Compared with static convolution kernels, the network can capture richer feature information, thereby enhancing model performance and generalization capabilities. Secondly, the present invention adopts the BiFPN structure in the neck of the model, with the aim of keeping the structure lightweight under the conditions of effective feature reuse and cross-layer connection mechanism. Finally, the present invention introduces the SEAM attention module in the deep layer of the model to further enhance the network's ability to learn abstract features in the image, thereby improving model performance; at the same time, the SEAM module can enhance the diseased area in the image and, conversely, weaken the background area, thereby improving the detection accuracy of occluded diseases and smaller target diseases.
[0010] Based on the first aspect, further, the above-mentioned dynamic convolution includes multiple convolution kernels, each convolution kernel shares the same kernel size and input / output dimensions, and is aggregated by adopting attention weights.
[0011] Based on the first aspect, further, the above BiFPN structure adopts a fast normalized fusion method to add additional weights to each input, allowing the network to learn the importance of different input features.
[0012] Based on the first aspect, further, the above-mentioned SEAM attention module includes a deep separable convolution with residual connection, a two-layer fully connected network, an exponential function processing layer and an attention mechanism.
[0013] Based on the first aspect, further, layer-by-layer and point-by-point convolution operations are performed based on depthwise separable convolution to perform feature fusion.
[0014] Based on the first aspect, a two-layer fully connected network is further used to integrate the information of each channel to strengthen the network's connection between different channels.
[0015] Based on the first aspect, further, the output of the SEAM attention module is multiplied by the original features based on the attention mechanism to enhance the ability of the target pipeline disease detection model to detect inter-class occlusion and small targets.
[0016] In a second aspect, the present invention provides a multi-type pipeline disease detection system based on improved YOLOv8, including a dynamic convolution module, a model optimization module and a disease detection module, wherein:
[0017] Dynamic convolution module, which is used to introduce dynamic convolution in the backbone feature extraction network based on YOLOv8, and dynamically aggregate multiple convolution kernels according to the degree of attention paid to each input to build an initial detection model;
[0018] The model optimization module is used to adopt the BiFPN structure in the neck of the initial detection model and introduce the SEAM attention module in the deep layer of the initial detection model to enhance the defect area in the image to build the target pipeline defect detection model;
[0019] The disease detection module is used to detect pipeline diseases based on the target pipeline disease detection model. The backbone feature extraction network based on the target pipeline disease detection model extracts key features from the input pipeline image through convolution operations. The neck network uses the feature pyramid network to fuse the extracted image features and generates an anchor frame containing feature mapping through the prediction head. For each anchor frame, the target pipeline disease detection model predicts its corresponding category probability and outputs the probability distribution of each anchor frame belonging to each category to realize the detection of multiple types of diseases.
[0020] This system uses the cooperation of multiple modules such as dynamic convolution module, model optimization module and disease detection module. Considering that there are many types and various forms of pipeline diseases, dynamic convolution is first introduced in the backbone feature extraction network. Compared with the static convolution kernel, the network can capture richer feature information, thereby enhancing the model performance and generalization ability. Secondly, the BiFPN structure is adopted in the neck of the model, with the aim of keeping the structure lightweight under the condition of effective feature reuse and cross-layer connection mechanism. Finally, the SEAM attention module is introduced in the deep layer of the model to further enhance the network's ability to learn abstract features in the image, thereby improving the model performance; at the same time, the SEAM module can enhance the diseased area in the image and, on the contrary, weaken the background area, thereby improving the detection accuracy of occluded diseases and smaller target diseases.
[0021] In a third aspect, the present application provides an electronic device, comprising a memory for storing one or more programs; a processor; when the one or more programs are executed by the processor, the method as described in any one of the first aspects above is implemented.
[0022] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of the first aspects above.
[0023] The present invention has at least the following advantages or beneficial effects:
[0024] The present invention provides a method and system for detecting multiple types of pipeline defects based on improved YOLOv8. First, dynamic convolution is introduced into the backbone feature extraction network. Compared with the static convolution kernel, the network can capture richer feature information, thereby enhancing the model performance and generalization ability. Secondly, the BiFPN structure is adopted in the neck of the model, with the purpose of keeping the structure lightweight under the condition of effective feature reuse and cross-layer connection mechanism. Finally, the SEAM attention module is introduced in the deep layer of the model to further enhance the network's learning ability for abstract features in the image, thereby improving the model performance; at the same time, the SEAM module can enhance the defect area in the image, and conversely weaken the background area, thereby improving the detection accuracy of occluded defects and smaller target defects. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 This is a flow chart of a method for detecting multiple types of pipeline defects based on improved YOLOv8 according to an embodiment of the present invention;
[0027] Figure 2 It is a schematic diagram of the overall framework of the model in the embodiment of the present invention;
[0028] Figure 3 Schematic diagram of the dynamic convolutional layer structure;
[0029] Figure 4 Schematic diagram for comparison of three feature fusion structures;
[0030] Figure 5 Schematic diagram of SEAM attention module;
[0031] Figure 6 A structural block diagram of an electronic device provided by an embodiment of the present invention.
[0032] Description of reference numerals: 101, memory; 102, processor; 103, communication interface. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0034] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0036] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0037] In the description of the embodiments of the present invention, "plurality" means at least 2.
[0038] Example:
[0039] like Figure 1-Figure 5 As shown, in the first aspect, an embodiment of the present invention provides a method for detecting multiple types of pipeline defects based on improved YOLOv8, comprising the following steps:
[0040] S1. Based on YOLOv8, dynamic convolution is introduced in the backbone feature extraction network, and multiple convolution kernels are dynamically aggregated according to the degree of attention to each input to build an initial detection model; the above dynamic convolution includes multiple convolution kernels, each convolution kernel shares the same kernel size and input / output dimensions, and is aggregated by adopting attention weights.
[0041] In some embodiments of the present invention, based on YOLOv8, dynamic convolution is first introduced in the backbone feature extraction network. It dynamically aggregates multiple convolution kernels according to the degree of attention paid to each input. Compared with static convolution kernels (i.e., only one convolution kernel is used per layer), dynamic convolution or methods with multiple convolution kernels can significantly improve the model's expressiveness, enabling the network to capture richer feature information, thereby enhancing the model's performance and generalization ability, while the additional computational cost it brings is negligible.
[0042] Lightweight networks usually limit the depth and width of the network due to their low computational budget, resulting in insufficient feature representation capabilities, which in turn leads to performance degradation. DynamicConv improves model capabilities by aggregating multiple convolution kernels through attention, without increasing the depth or width of the network. The traditional or static perceptron is usually expressed as formula (1):
[0043] y=g(W T x+b) (1)
[0044] Where W and b are the weight matrix and bias vector, and g is the activation function. The dynamic perceptron is defined by aggregating multiple (K) linear functions:
[0045]
[0046] Where x is the input vector, g represents the activation function, W is the weight matrix, b is the bias vector, and πk is the attention weight of the kth linear function. The weight {πk(x)} varies with the input x and represents the optimal linear set under the given input. Because the set model is a nonlinear function. Therefore, the dynamic perceptron has a stronger representation ability than the static perceptron. At the same time, the additional computational effort, as shown in formula (5), can be ignored:
[0047]
[0048] Similar to the dynamic perceptron, the dynamic convolution (see figure) has K convolution kernels that share the same kernel size and input / output dimensions, and are aggregated using attention weights of unit πk.
[0049] DynamicConv uses squeeze-and-excitation to calculate kernel attention. First, global spatial features are obtained through global average pooling, then mapped to K dimensions through two FC layers, and finally softmax normalization is performed. The obtained K attention weights are assigned to the K convolution kernels of this layer. Unlike SENet, SENet implements attention at the channel level, while DynamicConv treats the entire convolution kernel as an object to be noticed. Its structure is as follows: Figure 3 .
[0050] S2. The BiFPN structure is used in the neck of the initial detection model, and the SEAM attention module is introduced in the deep layer of the initial detection model to enhance the defect area in the image to build the target pipeline defect detection model;
[0051] Furthermore, the above BiFPN structure adopts a fast normalized fusion method to add additional weights to each input, allowing the network to learn the importance of different input features.
[0052] Furthermore, the SEAM attention module includes a deep separable convolution with residual connection, a two-layer fully connected network, an exponential function processing layer, and an attention mechanism. Based on the deep separable convolution, layer-by-layer and point-by-point convolution operations are performed to perform feature fusion. A two-layer fully connected network is used to integrate the information of each channel to strengthen the network's connection between different channels. Based on the attention mechanism, the output of the SEAM attention module is multiplied by the original feature to enhance the ability of the target pipeline disease detection model to detect inter-class occlusion and small targets.
[0053] In some embodiments of the present invention, the BiFPN structure is used in the neck of the model to keep the structure lightweight under the condition of effective feature reuse and cross-layer connection mechanism. BiFPN adds an additional feature fusion path to the nodes at the same level, fuses more features without increasing the cost, and optimizes the nodes with only one input. And the contribution of each input to the network is measured by additional weights to improve the effectiveness of feature fusion.
[0054] At the same time, the SEAM attention module is introduced in the deep layer of the model, because deep networks can often learn higher-level feature representations. By applying the SEAM module in the deep network, the network's ability to learn abstract features in the image can be further enhanced, thereby improving the model performance. At the same time, the SEAM attention module can enhance the diseased area in the image and conversely weaken the background area, thereby improving the detection accuracy of occluded diseases and smaller target diseases.
[0055] In the YOLO network after YOLOv4, the neck structure usually adopts the Path Aggregation Network (PANet) structure. This network enhances the original Feature Pyramid Network (FPN) by adding a bottom-up path, accelerates the transmission of low-level information to high-level through a direct path, and uses adaptive feature pooling technology to fully capture information at all levels, effectively integrating the rich semantic features of the high-level with the precise positioning information in the low-level high-resolution feature map. In addition to the above features, PANet also cleverly uses the upsampling layer to connect it horizontally with the feature map in the original Backbone. It not only helps to generate semantically rich features, but also effectively retains spatial information, thereby improving the model's perception of target location and details.
[0056] However, due to the large number of links in PANet, it inevitably causes the problem of high computational cost. In order to reduce the invalid links between different features, the bi-directional feature pyramid network (BiFPN) optimizes the original PANet structure. First, for nodes with only one input edge, their contribution to the network that fuses different features is relatively small, so they are directly removed. Secondly, an extra edge is added to the input and output nodes of the same level to fuse more features without increasing the cost.
[0057] Since different input features have different resolutions, their contributions to the output features are usually unequal. To solve this problem, BiFPN uses a fast normalized fusion method to add additional weights to each input, allowing the network to learn the importance of different input features:
[0058]
[0059] Among them, wi is a learnable weight, which can be a scalar, a vector or a multi-scale tensor; it is ensured by performing a ReLU operation on each one. Here η is a small quantity that ensures numerical stability; O represents the output feature map, I i Represents the original feature input.
[0060] BiFPN combines bidirectional cross-scale connections and fast normalization fusion, uses depth-wise separable convolution for feature fusion, and adds batch normalization and activation after each convolution. Figure 4 The structural diagrams of FPN, PANnet and BiFPN are shown respectively. Figure 4 (c) describes two fusion features of BiFPN at level 6:
[0061]
[0062] Among them, Ptd6 is the intermediate feature of the sixth level of the top-down path, Pout6 is the output feature of the sixth level of the bottom-up path, the Resize operation is usually a downsampling or upsampling operation, and w is the parameter we learned to distinguish the importance of different features in the feature fusion process.
[0063] In pipeline defect detection tasks, inter-class occlusion often leads to problems such as alignment errors, local aliasing, and feature loss. To solve these problems, the present invention introduces a novel multi-head attention network module, namely the Spatially Enhanced Attention Module (SEAM) module (see Figure 5). This module aims to achieve multi-scale vessel disease detection and highlight the diseased area in the image while reducing the influence of the background area. The first part of the SEAM module uses depthwise separable convolution with residual connection. Depthwise separable convolution is performed layer by layer, that is, channel-separated convolution. Although it can reduce the number of parameters and take into account the importance of different channels, it ignores the information relationship between channels. In order to compensate for the information loss, SEAM introduces pointwise convolution operation after the output of different depth convolution layers for feature fusion. Then, a two-layer fully connected network is used to integrate the information of each channel to strengthen the network's connection between different channels. This module is able to compensate for the information loss caused by occlusion by learning the relationship between occluded and unoccluded diseases. Next, SEAM applies an exponential function to the output learned by the fully connected layer to expand the value range from [0,1] to [1,e]. This exponential normalization provides a monotonic mapping relationship, making the model more tolerant to position errors. Finally, the output of the SEAM module is used as an attention mechanism to multiply the original features to enhance the model's ability to detect inter-class occlusion and small targets.
[0064] S3. Detect pipeline diseases based on the target pipeline disease detection model. The backbone feature extraction network based on the target pipeline disease detection model extracts key features from the input pipeline image through convolution operations. The neck network uses the feature pyramid network to fuse the extracted image features, and generates an anchor frame containing feature mapping through the prediction head. For each anchor frame, the target pipeline disease detection model predicts its corresponding category probability and outputs the probability distribution of each anchor frame belonging to each category, thereby realizing the detection of multiple types of diseases.
[0065] In some embodiments of the present invention, the backbone network extracts key features from the input image through convolution operations, the neck network uses a feature pyramid network to fuse the extracted image features, and uses an upsampling layer to combine low-level feature maps with high-level feature maps to improve detection accuracy. Finally, anchor boxes containing feature maps are generated through the prediction head. These anchor boxes have different aspect ratios and sizes and can cover targets of different sizes and shapes. For each anchor box, the model predicts its corresponding category probability and outputs the probability distribution of each anchor box belonging to each category, thereby achieving the detection of multiple types of diseases.
[0066] Taking into account the fact that pipeline diseases are of many types and various forms, the present invention first introduces dynamic convolution in the backbone feature extraction network. Compared with static convolution kernels, the network can capture richer feature information, thereby enhancing model performance and generalization capabilities. Secondly, the present invention adopts the BiFPN structure in the neck of the model, with the aim of keeping the structure lightweight under the conditions of effective feature reuse and cross-layer connection mechanism. Finally, the present invention introduces the SEAM attention module in the deep layer of the model to further enhance the network's ability to learn abstract features in the image, thereby improving model performance; at the same time, the SEAM module can enhance the diseased area in the image and, conversely, weaken the background area, thereby improving the detection accuracy of occluded diseases and smaller target diseases.
[0067] In a second aspect, an embodiment of the present invention provides a multi-type pipeline disease detection system based on improved YOLOv8, including a dynamic convolution module, a model optimization module and a disease detection module, wherein:
[0068] Dynamic convolution module, which is used to introduce dynamic convolution in the backbone feature extraction network based on YOLOv8, and dynamically aggregate multiple convolution kernels according to the degree of attention paid to each input to build an initial detection model;
[0069] The model optimization module is used to adopt the BiFPN structure in the neck of the initial detection model and introduce the SEAM attention module in the deep layer of the initial detection model to enhance the defect area in the image to build the target pipeline defect detection model;
[0070] The disease detection module is used to detect pipeline diseases based on the target pipeline disease detection model.
[0071] This system uses the cooperation of multiple modules such as dynamic convolution module, model optimization module and disease detection module. Considering that there are many types and various forms of pipeline diseases, dynamic convolution is first introduced in the backbone feature extraction network. Compared with the static convolution kernel, the network can capture richer feature information, thereby enhancing the model performance and generalization ability. Secondly, the BiFPN structure is adopted in the neck of the model, with the aim of keeping the structure lightweight under the condition of effective feature reuse and cross-layer connection mechanism. Finally, the SEAM attention module is introduced in the deep layer of the model to further enhance the network's ability to learn abstract features in the image, thereby improving the model performance; at the same time, the SEAM module can enhance the diseased area in the image and, on the contrary, weaken the background area, thereby improving the detection accuracy of occluded diseases and smaller target diseases.
[0072] like Figure 6 As shown, in a third aspect, an embodiment of the present application provides an electronic device, which includes a memory 101 for storing one or more programs and a processor 102. When the one or more programs are executed by the processor 102, any method in the first aspect described above is implemented.
[0073] The memory 101, the processor 102 and the communication interface 103 are directly or indirectly electrically connected to each other to achieve data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The memory 101 can be used to store software programs and modules, and the processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 101. The communication interface 103 can be used to communicate signaling or data with other node devices.
[0074] Among them, the memory 101 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.
[0075] The processor 102 may be an integrated circuit chip with signal processing capability. The processor 102 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0076] In the embodiments provided in the present application, it should be understood that the disclosed method and system can also be implemented in other ways. The method and system embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the method and system, method and computer program product according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0077] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0078] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by the processor 102, a method as in any one of the first aspects described above is implemented. If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk.
[0079] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0080] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present application. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A multi-type pipeline disease detection method based on improved YOLOv8, characterized in that: The following steps are involved: Based on YOLOv8, dynamic convolution is introduced in the backbone feature extraction network to dynamically aggregate multiple convolution kernels according to the degree of attention paid to each input to build an initial detection model; The BiFPN structure is used in the neck of the initial detection model, and the SEAM attention module is introduced in the deep layer of the initial detection model to enhance the defect area in the image to build the target pipeline defect detection model; Pipeline diseases are detected based on the target pipeline disease detection model. The backbone feature extraction network based on the target pipeline disease detection model extracts key features from the input pipeline image through convolution operations. The neck network uses the feature pyramid network to fuse the extracted image features, and generates anchor frames containing feature maps through the prediction head. For each anchor frame, the target pipeline disease detection model predicts its corresponding category probability and outputs the probability distribution of each anchor frame belonging to each category, thereby realizing the detection of multiple types of diseases.
2. According to claim 1, a method for detecting multiple types of pipeline defects based on improved YOLOv8 is characterized in that: The dynamic convolution includes multiple convolution kernels, each of which shares the same kernel size and input / output dimensions and is aggregated by adopting attention weights.
3. According to claim 1, a method for detecting multiple types of pipeline defects based on improved YOLOv8 is characterized in that: The BiFPN structure adopts a fast normalized fusion method to add additional weights to each input, allowing the network to learn the importance of different input features.
4. According to claim 1, a method for detecting multiple types of pipeline defects based on improved YOLOv8 is characterized in that: The SEAM attention module includes a deep separable convolution with residual connection, a two-layer fully connected network, an exponential function processing layer and an attention mechanism.
5. According to claim 4, a method for detecting multiple types of pipeline defects based on improved YOLOv8 is characterized in that: Based on depth-wise separable convolution, layer-by-layer and point-by-point convolution operations are performed to perform feature fusion.
6. The method for detecting multiple types of pipeline defects based on improved YOLOv8 according to claim 4, characterized in that: A two-layer fully connected network is used to integrate the information of each channel to strengthen the network's connection between different channels.
7. The method for detecting multiple types of pipeline defects based on improved YOLOv8 according to claim 4, characterized in that: Based on the attention mechanism, the output of the SEAM attention module is multiplied by the original features to enhance the ability of the target pipeline disease detection model to detect inter-class occlusion and small targets.
8. A multi-type pipeline disease detection system based on improved YOLOv8, characterized in that: It includes dynamic convolution module, model optimization module and disease detection module, among which: Dynamic convolution module, which is used to introduce dynamic convolution in the backbone feature extraction network based on YOLOv8, and dynamically aggregate multiple convolution kernels according to the degree of attention paid to each input to build an initial detection model; The model optimization module is used to adopt the BiFPN structure in the neck of the initial detection model and introduce the SEAM attention module in the deep layer of the initial detection model to enhance the defect area in the image to build the target pipeline defect detection model; The disease detection module is used to detect pipeline diseases based on the target pipeline disease detection model. The backbone feature extraction network based on the target pipeline disease detection model extracts key features from the input pipeline image through convolution operations. The neck network uses the feature pyramid network to fuse the extracted image features and generates an anchor frame containing feature mapping through the prediction head. For each anchor frame, the target pipeline disease detection model predicts its corresponding category probability and outputs the probability distribution of each anchor frame belonging to each category to realize the detection of multiple types of diseases.
9. An electronic device, characterized in that: include: A memory for storing one or more programs; processor; When the one or more programs are executed by the processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.