Crack defect detection model and implementation method thereof
By designing lightweight convolutional and feature fusion modules, the deep feature extraction capability of the wellbore fracture detection model is enhanced, solving the problems of low efficiency and high cost in traditional methods, and achieving high-precision and low-complexity wellbore fracture detection.
Patent Information
- Application Number
- CN202310401145.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-15
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-04-15
AI Technical Summary
Traditional wellbore defect detection relies on human visual identification, which is inefficient, costly, and dangerous. Existing deep learning algorithms are not effective in detecting low-contrast cracks in downhole wells and focus on deep semantic information while neglecting the importance of shallow geometric information.
We designed a lightweight convolutional module ECAConv, a feature extraction unit E-C3, and a feature fusion module ECACSP. We constructed a backbone network ECSP-Darknet53 and a neck feature fusion module E-Neck to enhance the ability to extract deep feature information from wellbore fractures and reduce model complexity.
It achieves high-precision detection of wellbore cracks and defects, reduces network inference time and computational cost, and is suitable for low-computing-power devices.
Smart Images

Figure CN116681645B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of target detection and relates to a detection model for crack defects and its implementation method. Background Technology
[0002] Shafts are the vital passageways in coal mining. Ruptures caused by cracks in the shaft walls can lead to major disasters. Regular inspections of the shaft walls and timely maintenance of defects such as cracks and water seepage are crucial for ensuring shaft safety and promoting the safe and efficient mining of coal resources. Traditional shaft wall defect detection relies mainly on human visual identification. This method is limited by visual resolution and suffers from low efficiency, high cost, and high risk.
[0003] Automatic detection of well wall defects is a future trend in green mining. Significant improvements in computational performance have greatly promoted the application of deep learning technology in crack detection for roads, bridges, and other applications. For example, Li et al. proposed a DBCC classification model combined with an improved window sliding algorithm for bridge crack detection, using a search strategy combining image pyramids and regions of interest to accelerate the algorithm. Peng et al. improved the YOLO algorithm, proposing YOLO-lump and YOLO-crack to enhance the network's ability to detect multiple defects, thus forming a fast bridge surface defect detection algorithm based on dual networks. Qin et al. proposed an end-to-end trainable deep convolutional neural network, DeepCrack, which learns multi-dimensional features from high-level convolutions to acquire more details and can better handle low-contrast cracks. The above detection algorithms have all achieved good detection results and have certain reference value for intelligent crack detection. However, they process images acquired under normal lighting conditions. In underground mines, lighting is dim, and the contrast between small cracks and the background is low. Therefore, when designing detection algorithms, it is necessary to pay more attention to the extraction of shallow features representing the crack topology.
[0004] Excellent lightweight network models, such as MobileNet, use depthwise separable convolutions to construct lightweight neural networks and introduce two hyperparameters to enable the network to be deployed on resource-constrained devices. See "Chollet F. Xception: Deep learning with depthwise separable convolutions[C] / / Proceedings of the IEEE conference on computer vision and pattern recognition.2017:1251-1258". ShuffleNet cleverly groups different feature maps of the input layer, uses different convolutional kernels to convolve each group, and then uses "channel shuffling" to realize the interaction of channel information. See "X. Zhang; X. Zhou; M. Lin; J. Sun. ShuffleNet: An extremely efficient convolutional neural network for mobile devices.in Proc.IEEE Conf.Comput.Vis.Pattern Recog.(CVPR),Jul.2017,arXiv:1707.01083". GhostNet proposes a novel feature map generation method that enriches feature maps with fewer parameters and computational cost through efficient linear operations. See "K. Han; Y. Wang; Q. Tian; J. Guo; C. Xu; C. Xu. GhostNet: More features from cheap operations. in Proc. IEEE Conf. Comput. Vis. Pattern Recog. (CVPR), Mar. 2020, arXiv: 1911.11907." To maximize detection accuracy while maintaining lightweight design, existing methods often focus on extracting deep semantic information, neglecting the role of shallow features. The geometric information expressed by shallow features is crucial for detecting small targets; as long as the topological structure of the crack can be obtained, the crack can be accurately located. Then, deep semantic information can be used to measure the degree of crack opening.
[0005] To achieve automatic detection of wellbore defects and to achieve accurate extraction of small crack targets while keeping the model lightweight, this invention designs a lightweight convolution module, a feature extraction module, and constructs a backbone network and a neck feature fusion module. It proposes a lightweight detection model for small crack defects in wellbore, E-YOLOv5s, which can enhance the network's feature extraction capabilities while reducing model complexity, thus better balancing the model's accuracy and lightweight design. Summary of the Invention
[0006] To address the aforementioned issues, this invention provides a crack defect detection model. By leveraging a lightweight backbone network, it enhances the network's ability to extract deep feature information from wellbore cracks while reducing network model parameters and floating-point computation. It improves upon the loss of detailed information during feature fusion by fusing features and enriching the expressive power of feature maps, while simultaneously accelerating network inference speed. This model facilitates the practical application of automated wellbore crack detection.
[0007] A second objective of this invention is to provide a method for detecting crack defects.
[0008] A third objective of this invention is to provide an electronic device.
[0009] A fourth objective of this invention is to provide a computer storage medium.
[0010] The technical solution adopted in this invention is a crack defect detection model, characterized in that it includes four modules: input, backbone network (ECSP-Darknet53), neck feature fusion module (E-Neck), and prediction output.
[0011] The backbone network ECSP-Darknet53 consists of one CBS unit, four EBS units, four E-C3 modules, and one SPPF. It aims to reduce network model parameters and floating-point operations while enhancing the network's ability to extract deep crack feature information.
[0012] The E-Neck feature fusion module is composed of 5 EBS units, 4 ECACSP modules, and multiple upsampling and splicing operations. It is responsible for fusing features, enriching the expressive power of the feature map, improving the problem of loss of detailed information during feature fusion, and accelerating the network inference speed.
[0013] The E-Neck is designed to fully integrate the geometric and semantic information of the small crack targets contained in the feature information extracted by ECSP-Darknet53;
[0014] The CBS unit is composed of a 6*6 Conv and BN, SiLU sequentially;
[0015] The EBS unit is composed of a lightweight convolutional module ECAConv and BN and SiLU sequentially.
[0016] The prediction output is responsible for providing the classification results of crack defects.
[0017] Furthermore, the lightweight convolution module ECAConv reduces the dimensionality of the input feature F0 using a 1*1 convolution to obtain F1. It then performs a depthwise separable convolution with a stride of 1 and a kernel of 5*5 and performs a padding operation to obtain feature F2. The concat fusion of F1 and F2 to obtain F3 introduces a channel attention module to solve the problem that the depthwise separable convolution brings to the model the problem of "separation" of input image information. Finally, feature F4 is extracted by ECAConv.
[0018] The feature extraction process of ECAConv is as follows:
[0019]
[0020] Where Conv 1×1 This represents a 1x1 convolution operation, DW 5×5 This indicates a 5x5 depth separable convolution; Concat indicates a concatenated operation; ECA indicates a channel focus operation.
[0021] The ECAConv is designed to enhance the comprehensive extraction capability of crack features.
[0022] Furthermore, the E-C3 consists of 3 ECAConv and n ECABottleNeck, and the number of ECABottleNeck in the four E-C3s contained in the backbone network ECSP-Darknet53 are 3, 6, 9 and 3 respectively;
[0023] The ECABottleNeck uses skip connections to perform concat fusion of the input features and the features extracted by two ECAConvs. The feature extraction process of the feature synthesis extraction unit E-C3 is as follows:
[0024]
[0025] Among them, E0 and E out E1 and E2 represent the input and output features of the E-C3 module, respectively. E1 represents the features extracted from E0 through a single ECAConv mapping. n n = 3, 6, 9, 3 represents the output of n ECABottleNecks, f ECAVonv This represents the mapping function of the ECAConv module, f ECABottleNeck This represents the mapping function of the ECABottleNeck module, and Concat represents the cascading operation.
[0026] Furthermore, the Spatial Pyramid Pool Fast Module (SPPF) consists of two CBS (1*1 Conv+BN+SiLU) layers, three 5*5 MaxPooling layers, and a Concat operation.
[0027] The SPPF uses 1*1 convolutions to reduce the dimensionality of complementary features extracted by four sets of EBS+E-C3 units, then sends them to three 5*5 MaxPooling layers connected in series, and then uses a Concat operation to fuse the output of each MaxPooling layer with the 1*1 convolution.
[0028] The SPPF achieves 9*9 and 13*13 convolution operations by cascading three 5*5 convolution kernels. This effectively avoids image distortion caused by image region cropping and scaling operations, solves the problem of repeated extraction of related features, greatly improves the generation speed of candidate frames, and thus saves computational costs.
[0029] Furthermore, the feature fusion module ECACSP consists of two CBSs (1*1Conv+BN+SiLU) and two EBSs with skip connections;
[0030] The ECACSP module first compresses the input features using a 1*1 convolutional channel of a CBS unit, then feeds them into two sequentially connected EBS units. Skip connections are used to propagate the features across stages to the outputs of the two EBS units, where they are cascaded and fused. Finally, the output is obtained after passing through a CBS unit to expand the channels. Its implementation process is as follows:
[0031]
[0032] Among them, C0 and C out These represent the input and output characteristics of the ECACSP module, respectively, f CBS The mapping function f represents the CBS cell. EBS This represents the mapping function for EBS units; Concat represents the cascading operation.
[0033] The first CBS unit of the ECACSP module retains the original feature fusion information to the greatest extent, while the two EBS modules are responsible for capturing more detailed information. At the same time, the ECA attention mechanism in the EBS module structure adopts a more efficient learning method, sharing the same learning parameters through fast one-dimensional convolution of the kernel. This makes the model lighter while effectively capturing cross-channel interactions, improving the quality of feature fusion and further improving the network detection accuracy. Finally, the fused feature information is concatenated and input into the last CBS module. Through the cross-stage hierarchical structure, richer gradient combination and feature expression capabilities are achieved, strengthening the network's feature fusion capabilities, reducing the complexity of computation and network structure, while maintaining sufficient accuracy and accelerating inference speed.
[0034] A method for detecting crack defects involves randomly dividing a crack dataset into a training set and a validation set in an 8:2 ratio, using the training set to train a crack defect detection model, and then using the trained model to detect cracks in the images to be detected.
[0035] Furthermore, a method for detecting crack defects, wherein crack detection is performed according to the following steps:
[0036] S1. The wellbore image is fed into the backbone network ECSP-Darknet53 to extract fracture features, and the shallow and deep features are simultaneously fed into the neck feature fusion module E-Neck in three ways.
[0037] The ECSP-Darknet53 expands the channels of the well wall image to be detected using 6*6 convolutions, and then feeds it into four sequentially connected EBS+E-C3 units to expand and compress the number of output feature channels. This aims to mine more multi-dimensional and multi-scale complementary features through a strategy of multiple dimensionality-upgrading and dimensionality-reducing operations on the channels. SPPF reduces the dimensionality of the complementary features extracted by the four EBS+E-C3 units using 1*1 convolutions, and then feeds them into three sequentially connected 5*5 MaxPool layers. A Concat operation is then used to fuse the outputs of each MaxPool layer and the 1*1 convolutions. By using concatenated convolution kernels of the same size to achieve 9*9 and 13*13 convolution operations, it effectively avoids image distortion caused by image region cropping and scaling operations, solves the problem of repeated extraction of related features, and greatly improves the speed of candidate box generation.
[0038] The ECSP-Darknet53 focuses on extracting shallow information representing the topological structure of cracks during feature extraction. After effectively extracting the geometric structure corresponding to the shallow information, it maximizes the extraction of semantic information represented by deep features, which helps to detect small targets in cracks.
[0039] S2, the three output features of the last three ECACSP modules of the E-Neck feature fusion module are fused and sent to the prediction output module;
[0040] S3. Predictive output completes crack detection, outputting the detection results of cracks on the well wall.
[0041] An electronic device that uses the above method to detect crack defects.
[0042] A computer storage medium storing at least one program instruction, which is loaded and executed by a processor to implement the above-described crack defect detection method.
[0043] The beneficial effects of this invention are as follows: To achieve timely and accurate detection of minute cracks in wellbore walls, this invention breaks away from the traditional approach of focusing on extracting deep semantic information and emphasizes the application of geometric structural information represented by shallow features, proposing a lightweight wellbore crack detection model, E-YOLOv5s. First, a lightweight convolutional module, ECAConv, is designed by integrating ordinary convolution, depthwise separable convolution, and ECA attention mechanism. Then, skip links are introduced to construct a feature synthesis extraction unit, E-C3, resulting in the backbone network ECSP-Darknet53, which significantly reduces network parameters while enhancing the ability to extract deep crack features. Next, a feature fusion module, ECACSP, is designed. Multiple sets of ECAConv and ECACSP modules are used to construct a neck feature fusion module, E-Neck, which aims to fully integrate the geometric information of small crack targets and the semantic information representing the degree of crack opening, while accelerating network inference speed. E-YOLOv5s can achieve high-precision detection of crack defects, contributing to the practical application of automatic wellbore crack detection. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a schematic diagram of the crack defect detection model according to an embodiment of the present invention.
[0046] Figure 2 This is a schematic diagram of the lightweight convolution module ECAConv according to an embodiment of the present invention.
[0047] Figure 3 This is a schematic diagram of the feature synthesis and extraction unit E-C3 in an embodiment of the present invention.
[0048] Figure 4 This is a schematic diagram of the structure of the Space Pyramid Pool Fast Module (SPPF) according to an embodiment of the present invention.
[0049] Figure 5 This is a schematic diagram of the ECACSP module in an embodiment of the present invention.
[0050] Figure 6 This is a comparison chart of the detection method of this invention with five classic target detection networks, namely YOLOv3-SPP, YOLOv4-CSP, YOLOv5s, YOLOX-s and YOLOv7, for the detection of crack defects. Detailed Implementation
[0051] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0052] Example 1,
[0053] A detection model for crack defects, the structure of which is as follows: Figure 1 As shown, it includes four modules: input, backbone network (ECSP-Darknet53), fine neck feature fusion module (E-Neck), and prediction output;
[0054] The backbone network ECSP-Darknet53 consists of 1 CBS unit, 4 EBS units, 4 E-C3 modules and 1 SPPF, aiming to reduce network model parameters and floating-point operations, while enhancing the network's ability to extract deep crack feature information.
[0055] The E-Neck feature fusion module is flexibly composed of 5 EBS units, 4 ECACSP modules, and multiple upsampling and splicing operations. It is responsible for fusing features, enriching the expressive power of the feature map, improving the problem of loss of detailed information during feature fusion, and accelerating the network inference speed.
[0056] E-Neck aims to fully integrate the geometric and semantic information of small crack targets contained in the feature information extracted by ECSP-Darknet53;
[0057] The CBS unit consists of a 6*6 Conv and BN, SiLU sequentially;
[0058] The EBS unit consists of a lightweight convolutional module ECAConv and BN and SiLU sequentially.
[0059] The prediction output is responsible for providing the classification results of crack defects.
[0060] like Figure 2 As shown,
[0061] The lightweight convolution module ECAConv reduces the dimensionality of the input feature F0 using a 1*1 convolution to obtain F1. It then performs a depthwise separable convolution with a stride of 1 and a kernel of 5*5 and performs padding to obtain feature F2. The concat fusion of F1 and F2 to obtain F3 introduces a channel attention module to solve the problem that the input image information brought to the model by the depthwise separable convolution is "separated". Finally, the feature F4 extracted by ECAConv is obtained.
[0062] The feature extraction process of ECAConv is as follows:
[0063]
[0064] Where Conv 1×1 This represents a 1x1 convolution operation, DW 5×5 This indicates a 5x5 depth separable convolution; Concat indicates a concatenated operation; ECA indicates a channel focus operation.
[0065] ECAConv is designed to enhance the comprehensive extraction capability of crack features.
[0066] like Figure 3 As shown,
[0067] E-C3 consists of 3 ECAConv and n ECABottleNeck. The number of ECABottleNeck in the four E-C3s contained in the backbone network ECSP-Darknet53 are 3, 6, 9 and 3 respectively.
[0068] ECABottleNeck uses skip connections to perform concat fusion of the input features and the features extracted by two ECAConv units. The feature extraction process of the feature synthesis and extraction unit E-C3 is as follows:
[0069]
[0070] Among them, E0 and E out E1 and E2 represent the input and output features of the E-C3 module, respectively. E1 represents the features extracted from E0 through a single ECAConv mapping. n n = 3, 6, 9, 3 represents the output of n ECABottleNecks, f ECAConv This represents the mapping function of the ECAConv module, f ECABottleNeck This represents the mapping function of the ECABottleNeck module, and Concat represents the cascading operation.
[0071] like Figure 4 As shown,
[0072] The Space Pyramid Pool Fast Module (SPPF) consists of two CBSs (1*1 Conv+BN+SiLU), three 5*5 MaxPooling layers, and a Concat operation.
[0073] SPPF uses 1x1 convolutions to reduce the dimensionality of complementary features extracted by four sets of EBS+E-C3 units, then sends them to three cascaded 5x5 MaxPooling layers, and uses a Concat operation to fuse the output of each MaxPooling layer with the 1x1 convolution. By cascading three 5x5 convolution kernels, SPPF achieves 9x9 and 13x13 convolution operations, which can effectively avoid image distortion caused by image region cropping and scaling operations, solve the problem of repeated extraction of related features, greatly improve the generation speed of candidate frames, and thus save computational costs.
[0074] like Figure 5 As shown,
[0075] The feature fusion module ECACSP consists of two CBSs (1*1 Conv+BN+SiLU), two EBSs, and skip connections;
[0076] The ECACSP module first compresses the input features using a 1x1 convolution of a CBS unit, then feeds them into two sequentially connected EBS units. Skip connections are used to propagate the features across stages to the outputs of the two EBS units, where they are cascaded and fused. Finally, the input features are expanded by a CBS unit to obtain the ECACSP output. Its implementation process is as follows:
[0077]
[0078] Among them, C0 and C out These represent the input and output characteristics of the ECACSP module, respectively, f CBS The mapping function f represents the CBS cell. EBS This represents the mapping function for EBS units; Concat represents the cascading operation.
[0079] The first CBS unit of the ECACSP module retains the original feature fusion information to the greatest extent. The two EBS modules are responsible for capturing more detailed information. At the same time, the ECA attention mechanism in the EBS module structure adopts a more efficient learning method, sharing the same learning parameters through fast one-dimensional convolution of the kernel. This makes the model lighter while effectively capturing cross-channel interactions, improving the quality of feature fusion and further improving the network detection accuracy. Finally, the fused feature information is concatenated and input into the last CBS module. Through the cross-stage hierarchical structure, richer gradient combination and feature expression capabilities are achieved, strengthening the network's feature fusion ability, reducing the complexity of computation and network structure, while maintaining sufficient accuracy and accelerating inference speed.
[0080] Example 2,
[0081] A method for detecting crack defects involves randomly dividing a crack dataset into a training set and a validation set in an 8:2 ratio, using the training set to train a crack defect detection model, and then using the trained model to detect cracks in the images to be detected.
[0082] A method for detecting crack defects, comprising the following steps:
[0083] S1. The wellbore image is fed into the backbone network ECSP-Darknet53 to extract fracture features, and the shallow and deep features are simultaneously fed into the neck feature fusion module E-Neck in three ways.
[0084] ECSP-Darknet53 expands the channels of the well wall image to be detected using 6*6 convolutions, and then feeds it into four sequentially connected EBS+E-C3 units to expand and compress the number of output feature channels. This aims to mine more multi-dimensional and multi-scale complementary features through a strategy of multiple dimensionality-upgrading and dimensionality-reducing operations on the channels. SPPF reduces the dimensionality of the complementary features extracted by the four EBS+E-C3 units using 1*1 convolutions, and then feeds them into three sequentially connected 5*5 MaxPool layers. A Concat operation is then used to fuse the outputs of each MaxPool layer and the 1*1 convolutions. By using concatenated convolutional kernels of the same size to achieve 9*9 and 13*13 convolution operations, it effectively avoids image distortion caused by image region cropping and scaling operations, solves the problem of repeated feature extraction, and greatly improves the speed of candidate box generation.
[0085] ECSP-Darknet53 focuses on extracting shallow information representing the topological structure of cracks during feature extraction. After effectively extracting the geometric structure corresponding to the shallow information, it maximizes the extraction of semantic information represented by deep features, which helps to detect small targets in cracks.
[0086] S2, the three output features of the last three ECACSP modules of the E-Neck feature fusion module are fused and sent to the prediction output module;
[0087] S3. Predictive output completes crack detection, outputting the detection results of cracks on the well wall.
[0088] To verify the detection performance of E-YOLOv5s in this invention, a comparative experiment was conducted. The dataset was created using collected wellbore images, including images of healthy and defective wellbore walls. Based on the severity of cracks, defects were categorized into four types: serious, medium, light, and normal. After image segmentation and compression, the labelImg software was used to label all images according to these categories. The resulting labeled sample library contains 3000 images, which were randomly divided into training and validation sets in an 8:2 ratio.
[0089] The five classic object detection networks compared are YOLOv3-SPP (see "Joseph Redmon and Ali Farhadi. YOLOv3: An incremental improvement. arXiv preprint arXiv:1804.02767, 2018."), YOLOv4-CSP (see "Chien-Yao Wang, Alexey Bochkovskiy, and Hong-Yuan MarkLiao. Scaled-YOLOv4: Scaling cross-stage partial network. In Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 13029–13038, 2021."), YOLOv5s (see "Jocher Glenn. YOLOv5 release v6.1. https: / / github.com / ultralytics / yolov5 / releases / tag / v6.1, 2022"), and YOLOX-s (see "Zheng Ge, Songtao..."). Liu, Feng Wang, Zeming Li, and Jian Sun. YOLOX: Exceeding YOLO series in 2021. arXiv preprint arXiv:2107.08430,2021.) and YOLOv7 (see “Wang CY, Bochkovskiy A, Liao HY M. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors[J]. arXiv preprint arXiv:2207.02696,2022”), the comparative test results are shown in Table 1, where bold represents the best performance.
[0090] Table 1 Comparison of experimental results for different detection models
[0091]
[0092] As shown in Table 1, the detection accuracies of YOLOv3-SPP, YOLOv4-CSP, and YOLOv7 networks are 81.5%, 83.2%, and 82.3%, respectively. Their detection performance is lower than that of E-YOLOv5s, and the large size and high floating-point computation of these three algorithms are unfavorable for real-time detection of small target defects such as cracks. Among the YOLO series, YOLOX-s achieves the best detection accuracy at 84.6%. It employs new technologies such as Anchor-free, decoupled head, and SimOTA in its prediction output, resulting in high precision and recall. While E-YOLOv5s has slightly lower precision and recall compared to YOLOv5s, it reduces the number of parameters by 57.0%, the floating-point computation by 66.8%, and improves the overall performance index (map) by 0.6%. While improving the detection accuracy of the network, E-YOLOv5s has a model size of only 3.87M, which is 44.9% smaller than the YOLOv5s network, reduces floating-point operations by 43.7%, and slightly improves precision and recall. The experimental results show that the E-YOLOv5s network has good robustness and low model complexity, with satisfactory performance across all aspects, making it more suitable for detecting cracks and small target defects in low-computing-power embedded devices.
[0093] like Figure 6 As shown,
[0094] Four sets of small crack well wall defect images were randomly selected from the test set for detection. Images ① and ②, showing small crack defects against simple backgrounds, showed E-YOLOv5s with detection accuracies of 80% and 85%, respectively, higher than the other five algorithms. This is because E-YOLOv5s effectively extracted both shallow geometric and deep semantic information from the well wall images, fully fusing the crack topology represented by geometric information with the subtle targets expressed by semantic information. Images ③ and ④ had more complex well wall backgrounds, with multiple cracks mixed together and significant differences between the background and crack information. However, E-YOLOv5s achieved detection accuracies of 87%, 82%, and 81%, respectively, similar to YOLOX-s but still superior to other detection algorithms. In summary, E-YOLOv5s is more accurate in detecting small crack targets, effectively extracting defect feature information from small crack targets in the well wall. It also maintains high detection accuracy even against complex backgrounds. Furthermore, its lightweight design makes it suitable for low-computing embedded devices, making it better suited for practical computer vision tasks.
[0095] As can be seen, the E-YOLOv5s network proposed in this invention still has high detection accuracy even under different complexity backgrounds, and its lightweight model can meet the application requirements of mobile devices.
[0096] If the crack defect detection method described in this embodiment of the invention is implemented as a software functional 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 this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the image reconstruction method described in this embodiment of the invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0097] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A method for detecting crack defects, characterized in that, The crack dataset is randomly divided into a training set and a validation set in an 8:2 ratio. A crack defect detection model is trained using the training set, and the trained model is used to detect cracks in the images to be detected. The crack defect detection model consists of four modules: input, backbone network ECSP-Darknet53, fine neck feature fusion module E-Neck, and prediction output. The backbone network ECSP-Darknet53 consists of one CBS unit, four EBS units, four E-C3 modules, and one SPPF. Each CBS unit comprises a 6x6 Conv module and sequentially uses BN and SiLU. Each EBS unit comprises a lightweight convolutional module ECAConv and sequentially uses BN and SiLU. Each E-C3 module consists of three ECAConv modules and n ECABottleNeck modules. The number of ECABottleNecks in the four E-C3s contained in the backbone network ECSP-Darknet53 are 3, 6, 9, and 3 respectively. The lightweight convolution module ECAConv reduces the input feature F0 to dimensionality using a 1*1 convolution to obtain F1. It then performs a depthwise separable convolution with a stride of 1 and a kernel of 5*5 and performs a padding operation to obtain feature F2. The concat fusion of F1 and F2 to obtain F3 is introduced into the channel attention module, and finally the feature F4 extracted by ECAConv is obtained. The feature extraction process of ECAConv is as follows: Where Conv 1×1 This represents a 1x1 convolution operation, DW 5×5 This indicates a 5x5 depth separable convolution; Concat indicates a concatenated operation; ECA indicates a channel focus operation. The ECABottleNeck uses skip connections to perform concat fusion of the input features and the features extracted by two ECAConvs. The feature extraction process of the feature synthesis extraction unit E-C3 is as follows: Among them, E0 and E out E1 and E2 represent the input and output features of the E-C3 module, respectively. E1 represents the features extracted from E0 through a single ECAConv mapping. n n = 3, 6, 9, 3 represents the output of n ECABottleNecks, f ECAConv This represents the mapping function of the ECAConv module, f ECABottleNeck This represents the mapping function of the ECABottleNeck module; Concat represents the cascading operation. The Spatial Pyramid Pooling Fast Module (SPPF) consists of two CBS layers composed of 1*1 Conv+BN+SiLU, three 5*5 MaxPooling layers, and Concat. SPPF uses 1*1 convolutions to reduce the dimensionality of complementary features extracted by four EBS+E-C3 units, then sends them to three cascaded 5*5 MaxPooling layers, and finally uses Concat to fuse the outputs of each MaxPooling layer with the 1*1 convolutions. The E-Neck consists of 5 EBS units and 4 ECACSP modules, wherein the outputs of 2 EBS units are upsampled and spliced with the feature information extracted by ECSP-Darknet53. The feature fusion module ECACSP consists of two CBSs composed of 1*1 Conv+BN+SiLU and two EBSs. The ECACSP module first compresses the input features using a 1*1 convolutional channel of a CBS unit, then feeds them into two sequentially connected EBS units. Skip connections are used to propagate the features across stages to the outputs of the two EBS units, where they are cascaded and fused. Finally, the output is obtained after passing through a CBS unit to expand the channels. Its implementation process is as follows: Among them, C0 and C out These represent the input and output characteristics of the ECACSP module, respectively, f CBS The mapping function f represents the CBS cell. EBS This represents the mapping function for EBS units, and Concat represents the cascading operation.
2. The method for detecting crack defects according to claim 1, characterized in that, Crack detection is performed according to the following steps: S1. The wellbore image is fed into the backbone network ECSP-Darknet53 to extract fracture features, and the shallow and deep features are simultaneously fed into the neck feature fusion module E-Neck in three ways. The ECSP-Darknet53 takes the well wall image to be detected, performs channel expansion by 6*6 convolution, and then feeds it into four sequentially connected EBS+E-C3 units. SPPF uses 1*1 convolution to reduce the dimensionality of the complementary features extracted by the four EBS+E-C3 units, and then feeds them into three serially connected 5*5 MaxPool layers. Finally, the Concat operation is used to fuse the output of each MaxPool layer and the 1*1 convolution. S2, the three output features of the last three ECACSP modules of the E-Neck feature fusion module are fused and sent to the prediction output module; S3. Predictive output completes crack detection, outputting the detection results of cracks on the well wall.
3. A computer storage medium, characterized in that, The storage medium stores at least one program instruction, which is loaded and executed by a processor to implement the crack defect detection method as described in claim 1 or 2.