Methods, apparatus, equipment and readable storage media for detecting defects in cable insulation
By constructing a defect extraction model consisting of a super-resolution module, a multi-scale feature extraction module, an attention mechanism module, and a feature fusion module, the problem of cable insulation defect detection was solved, achieving high-precision and high-reliability detection results.
Patent Information
- Application Number
- CN202411453435.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-10-17
AI Technical Summary
Defects such as pinholes, scratches, insulation damage, cracks, bubbles, corrosion, and wear can easily occur in cable insulation layers during production and use, leading to reduced cable life and safety hazards. Existing technologies are unable to effectively detect these defects.
A defect extraction model is constructed using a super-resolution module, a multi-scale feature extraction module, an attention mechanism module, and a feature fusion module. By optimizing and reconstructing cable images, insulation layer features are extracted to detect whether there are defects in the cable insulation layer.
It improves the accuracy, precision, and reliability of cable insulation layer inspection, enabling the identification of defects of different sizes and types, and enhancing comprehensiveness and accuracy.
Smart Images

Figure CN119359674B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cable technology, and more specifically, to a method, apparatus, equipment, and readable storage medium for detecting defects in cable insulation. Background Technology
[0002] Cables are the main connecting equipment in power grids; therefore, their safety is crucial for the safe and stable operation of the entire power grid. However, during cable production and use, defects such as pinholes, scratches, insulation damage, cracks, bubbles, corrosion, and wear inevitably occur in the cable insulation layer. These defects not only reduce the cable's service life and transmission efficiency but may also cause serious safety hazards, threatening economic benefits and public safety.
[0003] Therefore, there is an urgent need to provide a method for detecting defects in cable insulation layers, so as to promptly address these defects and maintain the safe and stable operation of the power grid. Summary of the Invention
[0004] In view of this, this application provides a method, apparatus, device and readable storage medium for detecting defects in cable insulation layers, used to detect whether defects exist in cable insulation layers.
[0005] To achieve the above objectives, the following solution is proposed:
[0006] A method for detecting defects in cable insulation includes:
[0007] The method involves obtaining a cable insulation layer image and a defect extraction model that includes a super-resolution module, a multi-scale feature extraction module, an attention mechanism module, a feature fusion module, and a decision layer. The super-resolution module is trained to improve the resolution and clarity of the input cable image.
[0008] Using the defect extraction model, the cable insulation layer image is optimized and reconstructed to form a super-resolution cable image. The insulation layer features of the super-resolution cable image are extracted, analyzed, and the presence of insulation layer defects in the cable insulation layer image is detected.
[0009] Optionally, the step of optimizing and reconstructing the cable insulation layer image using the defect extraction model to form a super-resolution cable image, extracting the insulation layer features of the super-resolution cable image, analyzing the insulation layer features, and detecting whether there are insulation layer defects in the cable insulation layer image includes:
[0010] The super-resolution module is used to optimize and reconstruct the cable insulation layer diagram to form a super-resolution cable image;
[0011] The spatial and channel features of the super-resolution cable image are extracted using the multi-scale feature extraction module and the attention mechanism module.
[0012] The feature fusion module is used to fuse the spatial features and the channel features to form an insulating layer feature;
[0013] Using the decision layer, the similarity between the insulation layer characteristics and various insulation layer defects is analyzed to assess whether the cable insulation layer diagram contains insulation layer defects.
[0014] Optionally, the step of extracting spatial and channel features of the super-resolution cable image using the multi-scale feature extraction module and the attention mechanism module includes:
[0015] The multi-scale feature extraction module is used to perform stepwise feature extraction and downsampling on the super-resolution cable image to generate feature maps at different scales.
[0016] Using the attention mechanism module, a detection box for marking the detection region is generated in the super-resolution cable image. Based on the detection region, the spatial attention weights of the feature maps at each scale in each spatial dimension and the channel attention weights of the feature maps at each scale in each channel dimension are calculated. Based on each feature map, each spatial attention weight, and each channel attention weight, the spatial features and channel features of the super-resolution cable image are calculated.
[0017] Optionally, using the attention mechanism module, based on each feature map, each spatial attention weight, and each channel attention weight, the spatial features and channel features of the super-resolution cable image are calculated, including:
[0018] Using the attention mechanism module, feature information of each feature map in different spatial dimensions and feature information of each feature map in different channel dimensions are extracted. Based on the feature information and spatial attention weights of each feature map in each spatial dimension, the spatial features of each feature map are calculated. Based on the feature information and channel attention weights of each feature map in each channel dimension, the channel features of each feature map are calculated.
[0019] Optionally, the step of fusing the spatial features and the channel features using the feature fusion module to form the insulating layer features includes:
[0020] Using the feature fusion module, spatial features of feature maps at different scales are weighted and fused to form spatial fusion features, and channel features of feature maps at different scales are weighted and fused to form channel fusion features. The spatial fusion features and the channel fusion features are weighted and integrated to form insulating layer features.
[0021] Optionally, obtain the defect extraction model, including:
[0022] An initial defect extraction model is constructed, which includes an initial super-resolution module, an initial multi-scale feature extraction module, an initial attention mechanism module, an initial feature fusion module, and an initial decision layer.
[0023] A training set consisting of two types of cable insulation training images is obtained. One type of cable insulation training images are images of cable insulation under different environments captured by a high-definition camera. The other type of cable insulation images are images of cable insulation after downsampling, Gaussian noise is added, and homogenization is performed. Each cable insulation training image is labeled with a defect result indicating whether the corresponding cable insulation training image represents an insulation defect. The cable insulation training image corresponding to an insulation defect is also labeled with the defect type and the bounding box used to mark the defect area.
[0024] Using the initial defect extraction model, the resolution of each cable insulation training image is optimized to form an optimized training image. In each optimized training image, a prediction bounding box is constructed to indicate the defect-related region of the corresponding optimized training image. Based on the region where each prediction bounding box is located, the insulation training features of the corresponding optimized training image are extracted, and the prediction result of the corresponding optimized training image is determined based on the insulation training features.
[0025] Based on the predicted bounding box, prediction result and corresponding annotation of each optimized training image, the prediction loss of the initial defect extraction model is calculated.
[0026] Based on each prediction loss, the gradient descent method is used to optimize the initial super-resolution module, the initial multi-scale feature extraction module, the initial attention mechanism module, the initial feature fusion module, and / or the initial decision layer until the prediction loss is lower than the preset loss threshold. The final initial defect extraction model is then used as the defect extraction model.
[0027] Optionally, calculating the prediction loss of the initial defect extraction model based on the predicted bounding box, prediction result, and corresponding annotation of each optimized training image includes:
[0028] Determine a set of multi-task loss functions that combine bounding box position error function, result error function, and region offset error function;
[0029] Combining the aforementioned multi-task loss function set, the prediction loss for each optimized training image is calculated based on the predicted bounding box, prediction result, and corresponding annotation of each optimized training image.
[0030] A cable insulation defect detection device, comprising:
[0031] The acquisition module is used to acquire cable insulation layer images, and includes a defect extraction model comprising a super-resolution module, a multi-scale feature extraction module, an attention mechanism module, a feature fusion module, and a decision layer, wherein the super-resolution module is trained to improve the resolution and clarity of the input cable image;
[0032] The detection module is used to optimize and reconstruct the cable insulation layer image using the defect extraction model to form a super-resolution cable image, extract the insulation layer features of the super-resolution cable image, analyze the insulation layer features, and detect whether there are insulation layer defects in the cable insulation layer image.
[0033] A cable insulation defect detection device includes a memory and a processor;
[0034] The memory is used to store programs;
[0035] The processor is used to execute the program to implement each step of the above-described cable insulation layer defect detection method.
[0036] A readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the various steps of the above-described cable insulation defect detection method.
[0037] As can be seen from the above technical solution, the cable insulation layer defect detection method provided in this application can acquire a cable insulation layer image and includes a defect extraction model comprising a super-resolution module, a multi-scale feature extraction module, an attention mechanism module, a feature fusion module, and a decision layer. The super-resolution module is trained to improve the resolution and clarity of the input cable image. Using the defect extraction model, the cable insulation layer image is optimized and reconstructed to form a super-resolution cable image. Insulation layer features are extracted from the super-resolution cable image, analyzed, and the presence of insulation layer defects in the cable insulation layer image is detected. Based on this, this application can utilize the super-resolution module to improve the resolution and clarity of the cable insulation layer image, forming a super-resolution cable image, thereby improving the accuracy of detection and feature extraction. Subsequently, the multi-scale feature extraction module can extract feature information at different scales, enabling this application to identify defects of different sizes and types, effectively capturing feature information of large-area defects and local small defects, improving the comprehensiveness and accuracy of detection. The attention mechanism module focuses on key areas of the image, automatically allocating more attention to these key areas, highlighting important features, and suppressing interference from redundant features, thereby further improving detection accuracy. It is evident that this application can improve the accuracy, precision, and reliability of cable insulation defect detection. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application 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 embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0039] Figure 1 This is a flowchart of a cable insulation layer defect detection method disclosed in an embodiment of this application;
[0040] Figure 2 This is a structural block diagram of a cable insulation layer defect detection device disclosed in an embodiment of this application;
[0041] Figure 3 This is a hardware structure block diagram of a cable insulation layer defect detection device disclosed in an embodiment of this application. Detailed Implementation
[0042] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0043] The cable insulation defect detection method of this application can be used in a wide range of general-purpose or special-purpose computing environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor devices, distributed computing environments including any of the above devices, etc.
[0044] Next, combine Figure 1 The cable insulation defect detection method of this application is described in detail, including the following steps:
[0045] Step S1: Obtain the cable insulation layer image, and a defect extraction model that includes a super-resolution module, a multi-scale feature extraction module, an attention mechanism module, a feature fusion module, and a decision layer.
[0046] Specifically, it is possible to obtain images of cable insulation layers taken by the binocular camera of a drone.
[0047] The super-resolution module is trained to improve the resolution and clarity of the input cable image.
[0048] The multi-scale feature extraction module is constructed with the aim of extracting feature information at different scales from the input cable image.
[0049] The attention mechanism module is designed to highlight key defect areas in the input cable image.
[0050] Step S2: Using the defect extraction model, optimize and reconstruct the cable insulation layer image to form a super-resolution cable image, extract the insulation layer features of the super-resolution cable image, analyze the insulation layer features, and detect whether there are insulation layer defects in the cable insulation layer image.
[0051] Specifically, the cable insulation layer image can be input into the defect extraction model. Using the components of the defect extraction model, the cable insulation layer image can be optimized and reconstructed to form a super-resolution cable image. The insulation layer features of the super-resolution cable image can be extracted, the insulation layer features can be analyzed, and the presence of insulation layer defects in the cable insulation layer image can be detected.
[0052] As can be seen from the above technical solution, the cable insulation layer defect detection method provided in this application can acquire a cable insulation layer image, and includes a defect extraction model comprising a super-resolution module, a multi-scale feature extraction module, an attention mechanism module, a feature fusion module, and a decision layer. The super-resolution module is trained to improve the resolution and clarity of the input cable image. Using the defect extraction model, the cable insulation layer image is optimized and reconstructed to form a super-resolution cable image, and the insulation layer features of the super-resolution cable image are extracted, analyzed, and the presence of insulation layer defects in the cable insulation layer image is detected. Based on this, this application utilizes a super-resolution module to enhance the resolution and clarity of cable insulation layer images, forming super-resolution cable images and improving detection accuracy and feature extraction accuracy. Subsequently, a multi-scale feature extraction module can be used to extract feature information at different scales, enabling this application to identify defects of different sizes and types. Whether it is a large-area defect or a small local defect, its feature information can be effectively captured, improving the comprehensiveness and accuracy of detection. An attention mechanism module is used to focus on key areas of the image, automatically allocating more attention to these key areas, highlighting important features, and suppressing interference from redundant features, thereby further improving detection accuracy. Therefore, this application can improve the accuracy, precision, and reliability of cable insulation layer defect detection.
[0053] In some embodiments of this application, if there are multiple insulation layer defects in the cable insulation layer diagram, the defects are classified and prioritized.
[0054] In some embodiments of this application, the process of obtaining a defect extraction model in step S1, which includes a super-resolution module, a multi-scale feature extraction module, an attention mechanism module, a feature fusion module, and a decision layer, is described in detail below:
[0055] S10. Construct an initial defect extraction model with an initial super-resolution module, an initial multi-scale feature extraction module, an initial attention mechanism module, an initial feature fusion module, and an initial decision layer.
[0056] Specifically, an initial super-resolution module, an initial multi-scale feature extraction module, an initial attention mechanism module, an initial feature fusion module, and an initial decision layer can be built.
[0057] The initial super-resolution module, initial multi-scale feature extraction module, initial attention mechanism module, initial feature fusion module, and initial decision layer are combined to form the initial defect extraction model.
[0058] S11. Obtain a training set consisting of two types of cable insulation training images. One type of cable insulation training image consists of images of cable insulation under different environments captured by a high-definition camera. The other type consists of cable insulation images that have been downsampled, Gaussian noise has been added, and homogenization has been performed. Each cable insulation training image is labeled with a defect result indicating whether the corresponding cable insulation training image represents an insulation defect. The cable insulation training image corresponding to an insulation defect is also labeled with the defect type and a bounding box used to mark the defect area.
[0059] Specifically, training images of cable insulation layers under different environments can be captured using high-definition cameras;
[0060] Each training image is downsampled to generate a low-resolution image corresponding to each training image. Gaussian noise is added to each low-resolution image, and the low-resolution image after adding Gaussian noise is homogenized to form a new training image.
[0061] Training images can also be randomly cropped, rotated, and scaled to improve the model's robustness to different defect shapes and sizes.
[0062] The training set is composed of all the training images captured by the high-definition camera and all the new training images that have undergone homogenization.
[0063] Determine whether each image in the training set has an insulation layer defect. If so, add a bounding box containing the defect result, defect type, and a region for marking the defect to the corresponding cable insulation layer training image to form a cable insulation layer training image. If not, add a defect result indicating that the cable insulation layer training image does not have an insulation layer defect to the corresponding cable insulation layer training image to form a cable insulation layer training image.
[0064] Defect types can include insulation breakage, insulation wear, insulation cutting, insulation damage, and insulation aging.
[0065] S12. Using the initial defect extraction model, the resolution of each cable insulation training image is optimized to form an optimized training image. In each optimized training image, a prediction bounding box is constructed to indicate the defect-related region of the corresponding optimized training image. Based on the region where each prediction bounding box is located, the insulation training features of the corresponding optimized training image are extracted, and the prediction result of the corresponding optimized training image is determined based on the insulation training features.
[0066] Specifically, based on the initial defect extraction model, the resolution and sharpness of each cable insulation layer training image can be optimized to form an optimized training image;
[0067] Based on the initial defect extraction model, a predicted bounding box is constructed in each optimized training image to indicate the region where the defect is located in the corresponding optimized training image.
[0068] Focusing on the region where each predicted bounding box is located, extract the insulation layer training features of the corresponding optimized training image;
[0069] The prediction results for the corresponding optimized training images are determined based on the training features of the insulating layer.
[0070] S13. Based on the predicted bounding box, prediction result and corresponding annotation of each optimized training image, calculate the prediction loss of the initial defect extraction model.
[0071] Specifically, the predicted bounding box and prediction result of each optimized training image can be compared with their corresponding annotation to calculate the prediction loss of the initial defect extraction model.
[0072] The annotation of each optimized training image can include the defect results of the corresponding cable insulation training image. When the corresponding defect results indicate the presence of insulation defects, the annotation also includes the bounding box of the corresponding cable insulation training image.
[0073] S14. Based on each prediction loss, the gradient descent method is used to optimize the initial super-resolution module, the initial multi-scale feature extraction module, the initial attention mechanism module, the initial feature fusion module, and / or the initial decision layer until the prediction loss is lower than the preset loss threshold. The final initial defect extraction model is then used as the defect extraction model.
[0074] Specifically, using the predicted loss as a reference, the gradient descent method is employed to adjust the parameters of the initial super-resolution module, the initial multi-scale feature extraction module, the initial attention mechanism module, the initial feature fusion module, and / or the initial decision layer until the predicted loss is lower than a preset loss threshold. The final initial super-resolution module is taken as the super-resolution module, the final initial multi-scale feature extraction module is taken as the multi-scale feature extraction module, the final initial attention mechanism module is taken as the attention mechanism module, the final initial feature fusion module is taken as the feature fusion module, the final initial decision layer is taken as the decision layer, and the final initial defect extraction model is taken as the defect extraction model.
[0075] As can be seen from the above technical solution, this embodiment provides an optional method for obtaining a defect extraction model. Through the above method, the defect extraction model can be trained, thereby improving the reliability of the defect extraction model of this application.
[0076] In some embodiments of this application, the process of calculating the prediction loss of the initial defect extraction model based on the predicted bounding box, prediction result, and corresponding annotation of each optimized training image in step S13 is described in detail as follows:
[0077] S130. Determine a multi-task loss function group that combines the bounding box position error function, the result error function, and the region offset error function.
[0078] Specifically, a bounding box position error function with a scale factor and mean square error can be constructed to improve the prediction accuracy of the bounding box.
[0079] An error function that incorporates focus loss can be constructed.
[0080] A region offset error function that incorporates geometric factors can be constructed.
[0081] The region offset error function can be used to evaluate the shape and positional changes of the predicted bounding box, penalizing the aspect ratio, center point offset, etc. of the predicted bounding box to ensure the matching degree between the geometric characteristics of the predicted bounding box and the actual defect area.
[0082] The loss function is dynamically adjusted during training to adapt to different detection tasks.
[0083] S131. Combining the multi-task loss function group, calculate the prediction loss for each optimized training image based on the predicted bounding box, prediction result, and corresponding annotation of each optimized training image.
[0084] Specifically, based on the multi-task loss function set, the boundary error between the predicted bounding box and the corresponding bounding box, the result error between the prediction result and the corresponding defect result, and the geometric characteristic error between the predicted bounding box and the corresponding bounding box can be calculated for each optimized training image.
[0085] The boundary error, the result error, and the geometric characteristic error of each optimized training image are weighted and fused to form the prediction loss for each optimized training image.
[0086] As can be seen from the above technical solution, this embodiment provides an optional method for calculating the prediction loss of the initial defect extraction model based on the predicted bounding box, prediction result and corresponding annotation of each optimized training image. The above method can improve the defect extraction model's ability to detect small target defects, measure the difference between the predicted bounding box and the actual bounding box, accurately predict the defect location and reduce errors; further optimize the accuracy of the bounding box, the calculation of which includes the geometric relationship between the overlapping part of the predicted box and the real box and the area outside the overlapping region.
[0087] In some embodiments of this application, step S2, which involves optimizing and reconstructing the cable insulation layer image using the defect extraction model to form a super-resolution cable image, extracting insulation layer features from the super-resolution cable image, analyzing the insulation layer features, and detecting whether there are insulation layer defects in the cable insulation layer image, is described in detail below:
[0088] S20. Using the super-resolution module, the cable insulation layer diagram is optimized and reconstructed to form a super-resolution cable image.
[0089] Specifically, the super-resolution module includes a generator network, a discriminator network, a processing network, and an equalization network.
[0090] By employing a layer-by-layer upsampling method in the generator network, the resolution of the super-resolution cable image is gradually increased during the super-resolution cable image generation process. The layer-by-layer upsampling method can be a deconvolutional layer or a pixel rearrangement method, combined with residual connections to stabilize the training process and reduce image distortion.
[0091] A discriminator network, structured as a convolutional neural network, is used to distinguish between generated super-resolution cable images and real high-resolution images.
[0092] The generated super-resolution cable images are post-processed using a processing network, including denoising and edge enhancement, to further improve the clarity and detail visibility of the super-resolution cable images.
[0093] Adaptive histogram equalization (CLAHE) and other techniques are used to improve the overall contrast of super-resolution cable images, ensuring that detailed features are more obvious for subsequent defect detection.
[0094] S21. Using the multi-scale feature extraction module and the attention mechanism module, extract the spatial features and channel features of the super-resolution cable image.
[0095] Specifically, the multi-scale feature extraction module and the attention mechanism module can be used in combination to obtain the spatial features corresponding to the spatial dimension of the super-resolution cable image and the channel features corresponding to the channel dimension.
[0096] S22. Using the feature fusion module, the spatial features and the channel features are fused to form an insulating layer feature.
[0097] Specifically, the feature fusion module can be used to perform weighted fusion of spatial features corresponding to the spatial dimension and channel features corresponding to the channel dimension to form insulation layer features.
[0098] S23. Using the decision layer, analyze the similarity between the insulation layer characteristics and various insulation layer defects, and evaluate whether the cable insulation layer diagram has insulation layer defects.
[0099] Specifically, the decision layer can be used to calculate the similarity between insulation layer characteristics and various types of insulation layer defects, and based on the similarity, to assess whether the cable insulation layer diagram has insulation layer defects.
[0100] As can be seen from the above technical solution, this embodiment provides an optional method to optimize and reconstruct the cable insulation layer image using the defect extraction model to form a super-resolution cable image, extract the insulation layer features of the super-resolution cable image, analyze the insulation layer features, and detect whether there are insulation layer defects in the cable insulation layer image. Through the above method, the various modules of the defect extraction model can be better utilized for detection and identification, thereby improving the reliability of detection and identification.
[0101] In some embodiments of this application, the process of extracting spatial and channel features of the super-resolution cable image using the multi-scale feature extraction module and the attention mechanism module is described in detail below:
[0102] S210. Using the multi-scale feature extraction module, perform step-by-step feature extraction and downsampling on the super-resolution cable image to generate feature maps of different scales.
[0103] Specifically, the multi-scale feature extraction module can consist of multiple convolutional layers and pooling layers.
[0104] Each convolutional layer can be a deep convolutional neural network, extracting low-level and high-level features of super-resolution cable images at different convolutional layers, and constructing a feature map containing multi-level feature representations;
[0105] Pooling layers reduce the size of feature maps step by step through max pooling or average pooling operations, reflecting feature information at different scales. This helps to capture global and local feature details, such as shape, texture, and color.
[0106] S211. Using the attention mechanism module, a detection box for marking the detection region is generated in the super-resolution cable image. Based on the detection region, the spatial attention weights of the feature maps at each scale in each spatial dimension and the channel attention weights of the feature maps at each scale in each channel dimension are calculated. Based on each feature map, each spatial attention weight and each channel attention weight, the spatial features and channel features of the super-resolution cable image are calculated.
[0107] Specifically, the attention mechanism module may include spatial attention mechanism and channel attention mechanism.
[0108] Spatial attention mechanisms can be used to calculate attention weights in each spatial dimension of the feature map, highlighting important spatial regions. Common methods include using global average pooling and global max pooling, with weighted calculations performed at corresponding positions.
[0109] Channel attention mechanisms are used to calculate attention weights for each channel dimension of the feature map, enhancing the importance of different channels. Common methods include using global average pooling or global max pooling, followed by calculating the attention weights for each channel through fully connected layers and activation functions.
[0110] As can be seen from the above technical solution, this embodiment provides an optional method for extracting the spatial features and channel features of the super-resolution cable image. The above method can better reflect the features of the detection area through spatial features and channel features, remove redundant features, and improve accuracy.
[0111] In some embodiments of this application, the process of calculating the spatial and channel features of the super-resolution cable image using the attention mechanism module based on each feature map, each spatial attention weight, and each channel attention weight is described in detail below:
[0112] S2110. Using the attention mechanism module, extract the feature information of each feature map in different spatial dimensions and the feature information of each feature map in different channel dimensions. Based on the feature information and spatial attention weights corresponding to each feature map in each spatial dimension, calculate the spatial features of each feature map. Based on the feature information and channel attention weights corresponding to each feature map in each channel dimension, calculate the channel features of each feature map.
[0113] Specifically, the attention mechanism module can be used to extract feature information of feature maps at different scales in different spatial dimensions, as well as feature information in different channel dimensions.
[0114] For each feature map, the spatial features of the feature map are calculated based on the product of the feature information corresponding to the feature map in each spatial dimension and its spatial attention weight. The channel features of each feature map are calculated based on the product of the feature information corresponding to the feature map in each channel dimension and its channel attention weight.
[0115] As can be seen from the above technical solution, this embodiment provides an optional method for extracting spatial and channel features of the super-resolution cable image based on each feature map, each spatial attention weight, and each channel attention weight using an attention mechanism module. This method can highlight important areas, strengthen relevant feature channels, enhance the importance of different channels, assign higher weights to small-sized defect features and wear-related features, and assign lower weights to cable sheath-related features with weak feature correlation. This effectively suppresses the interference of irrelevant features, better completes feature extraction, and thus improves the reliability of defect identification.
[0116] In some embodiments of this application, the process of fusing the spatial features and the channel features using the feature fusion module to form the insulating layer features is described in detail, and the steps are as follows:
[0117] S220. Using the feature fusion module, the spatial features of feature maps at different scales are weighted and fused to form spatial fusion features, and the channel features of feature maps at different scales are weighted and fused to form channel fusion features. The spatial fusion features and the channel fusion features are weighted and integrated to form insulating layer features.
[0118] Specifically, the feature fusion module can be used to weight and combine spatial features from feature maps at different scales to generate spatial fusion features, and weight and combine channel features from feature maps at different scales to generate channel fusion features.
[0119] Using the feature fusion module, spatial fusion features and channel fusion features are weighted and integrated to generate insulation layer features.
[0120] As can be seen from the above technical solution, this embodiment provides an optional method to fuse the spatial features and the channel features using the feature fusion module to form insulation layer features. The above method can integrate feature information of different scales and different levels, and enhance the ability of the defect extraction model to identify cable insulation layer defects.
[0121] Next, we will combine Figure 2 This application provides a detailed description of the cable insulation defect detection device. The cable insulation defect detection device described below can be compared with the cable insulation defect detection method described above.
[0122] See Figure 2 It can be observed that cable insulation defect detection devices may include:
[0123] The acquisition module 10 is used to acquire cable insulation layer images, and includes a defect extraction model comprising a super-resolution module, a multi-scale feature extraction module, an attention mechanism module, a feature fusion module, and a decision layer. The super-resolution module is trained to improve the resolution and clarity of the input cable image.
[0124] The detection module 20 is used to optimize and reconstruct the cable insulation layer image using the defect extraction model to form a super-resolution cable image, extract the insulation layer features of the super-resolution cable image, analyze the insulation layer features, and detect whether there are insulation layer defects in the cable insulation layer image.
[0125] Furthermore, the acquisition module may include:
[0126] The initial defect extraction model building unit is used to construct an initial defect extraction model that includes an initial super-resolution module, an initial multi-scale feature extraction module, an initial attention mechanism module, an initial feature fusion module, and an initial decision layer.
[0127] The cable insulation training image acquisition unit is used to acquire a training set consisting of two types of cable insulation training images. One type of cable insulation training image is an image of cable insulation under different environments captured by a high-definition camera. The other type is an image of cable insulation after downsampling, adding Gaussian noise, and homogenization. Each cable insulation training image is labeled with a defect result indicating whether the corresponding cable insulation training image represents an insulation defect. The cable insulation training image corresponding to an insulation defect is also labeled with the defect type and a bounding box used to mark the defect area.
[0128] The optimized training image acquisition unit is used to optimize the resolution of each cable insulation layer training image using the initial defect extraction model to form an optimized training image. In each optimized training image, a prediction bounding box is constructed to indicate the defect-related region of the corresponding optimized training image. Based on the region where each prediction bounding box is located, the insulation layer training features of the corresponding optimized training image are extracted, and the prediction result of the corresponding optimized training image is determined based on the insulation layer training features.
[0129] The prediction loss calculation unit is used to calculate the prediction loss of the initial defect extraction model based on the predicted bounding box, prediction result and corresponding annotation of each optimized training image.
[0130] The initial defect extraction model optimization unit is used to optimize the initial super-resolution module, initial multi-scale feature extraction module, initial attention mechanism module, initial feature fusion module and / or initial decision layer based on each prediction loss using the gradient descent method, until the prediction loss is lower than a preset loss threshold, and the final initial defect extraction model is used as the defect extraction model.
[0131] Furthermore, the loss prediction calculation unit may include:
[0132] The multi-task loss function group determination component is used to determine a multi-task loss function group that combines the bounding box position error function, the result error function, and the region offset error function.
[0133] The multi-task loss function group utilizes a component to combine the multi-task loss function group to calculate the prediction loss for each optimized training image based on the predicted bounding box, prediction result, and corresponding annotation of each optimized training image.
[0134] Furthermore, the detection module may include:
[0135] A super-resolution cable image construction unit is used to optimize and reconstruct the cable insulation layer diagram using the super-resolution module to form a super-resolution cable image;
[0136] The channel feature extraction unit is used to extract the spatial features and channel features of the super-resolution cable image using the multi-scale feature extraction module and the attention mechanism module.
[0137] An insulating layer feature construction unit is used to fuse the spatial features and the channel features using the feature fusion module to form an insulating layer feature;
[0138] An insulation layer defect assessment unit is used to analyze the similarity between the insulation layer characteristics and various types of insulation layer defects using the decision layer, and to assess whether the cable insulation layer diagram has insulation layer defects.
[0139] Furthermore, the channel feature extraction unit may include:
[0140] A multi-scale feature map generation component is used to perform stepwise feature extraction and downsampling on the super-resolution cable image using the multi-scale feature extraction module to generate feature maps of different scales.
[0141] A spatial attention weight calculation component is used to generate detection boxes for marking detection regions in the super-resolution cable image using the attention mechanism module. Based on the detection regions, it calculates the spatial attention weights of feature maps at each scale in each spatial dimension and the channel attention weights of feature maps at each scale in each channel dimension. Based on each feature map, each spatial attention weight, and each channel attention weight, it calculates the spatial features and channel features of the super-resolution cable image.
[0142] Furthermore, the spatial attention weight calculation component may include:
[0143] The feature information extraction sub-component is used to extract feature information of each feature map in different spatial dimensions and feature information of each feature map in different channel dimensions using the attention mechanism module. Based on the feature information and spatial attention weights corresponding to each feature map in each spatial dimension, the spatial features of each feature map are calculated. Based on the feature information and channel attention weights corresponding to each feature map in each channel dimension, the channel features of each feature map are calculated.
[0144] Furthermore, the insulating layer feature building blocks may include:
[0145] A spatial fusion feature generation component is used to utilize the feature fusion module to perform weighted fusion of spatial features of feature maps at different scales to form spatial fusion features, and to perform weighted fusion of channel features of feature maps at different scales to form channel fusion features. The spatial fusion features and the channel fusion features are then weighted and integrated to form insulating layer features.
[0146] The cable insulation layer defect detection device provided in this application embodiment can be applied to cable insulation layer defect detection equipment, such as PC terminals, cloud platforms, servers, and server clusters. Optionally, Figure 3 The hardware structure block diagram of the cable insulation defect detection equipment is shown. (Refer to...) Figure 3 The hardware structure of a cable insulation layer defect detection device may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4;
[0147] In this embodiment of the application, the number of processor 1, communication interface 2, memory 3, and communication bus 4 is at least one, and processor 1, communication interface 2, and memory 3 communicate with each other through communication bus 4;
[0148] Processor 1 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0149] Memory 3 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device;
[0150] The memory stores a program, which the processor can call. The program is used for:
[0151] The method involves obtaining a cable insulation layer image and a defect extraction model that includes a super-resolution module, a multi-scale feature extraction module, an attention mechanism module, a feature fusion module, and a decision layer. The super-resolution module is trained to improve the resolution and clarity of the input cable image.
[0152] Using the defect extraction model, the cable insulation layer image is optimized and reconstructed to form a super-resolution cable image. The insulation layer features of the super-resolution cable image are extracted, analyzed, and the presence of insulation layer defects in the cable insulation layer image is detected.
[0153] Optionally, the refined and extended functions of the program can be referred to the above description.
[0154] This application embodiment also provides a readable storage medium that can store a program suitable for execution by a processor, the program being used for:
[0155] The method involves obtaining a cable insulation layer image and a defect extraction model that includes a super-resolution module, a multi-scale feature extraction module, an attention mechanism module, a feature fusion module, and a decision layer. The super-resolution module is trained to improve the resolution and clarity of the input cable image.
[0156] Using the defect extraction model, the cable insulation layer image is optimized and reconstructed to form a super-resolution cable image. The insulation layer features of the super-resolution cable image are extracted, analyzed, and the presence of insulation layer defects in the cable insulation layer image is detected.
[0157] Optionally, the refined and extended functions of the program can be referred to the above description.
[0158] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0159] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0160] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. The various embodiments of this application can be combined with each other. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting defects in cable insulation, characterized in that, include: The method involves obtaining a cable insulation layer image and a defect extraction model that includes a super-resolution module, a multi-scale feature extraction module, an attention mechanism module, a feature fusion module, and a decision layer. The super-resolution module is trained to improve the resolution and clarity of the input cable image. The super-resolution module is used to optimize and reconstruct the cable insulation layer diagram to form a super-resolution cable image; The multi-scale feature extraction module is used to perform stepwise feature extraction and downsampling on the super-resolution cable image to generate feature maps at different scales. Using the attention mechanism module, a detection box for marking the detection region is generated in the super-resolution cable image. Based on the detection region, the spatial attention weights of the feature maps at each scale in each spatial dimension and the channel attention weights of the feature maps at each scale in each channel dimension are calculated. Based on each feature map, each spatial attention weight and each channel attention weight, the spatial features and channel features of the super-resolution cable image are calculated. The feature fusion module is used to fuse the spatial features and the channel features to form an insulating layer feature; Using the decision layer, the similarity between the insulation layer characteristics and various insulation layer defects is analyzed to assess whether the cable insulation layer diagram contains insulation layer defects.
2. The cable insulation layer defect detection method according to claim 1, characterized in that, Using the attention mechanism module, based on each feature map, each spatial attention weight, and each channel attention weight, the spatial and channel features of the super-resolution cable image are calculated, including: Using the attention mechanism module, feature information of each feature map in different spatial dimensions and feature information of each feature map in different channel dimensions are extracted. Based on the feature information and spatial attention weights of each feature map in each spatial dimension, the spatial features of each feature map are calculated. Based on the feature information and channel attention weights of each feature map in each channel dimension, the channel features of each feature map are calculated.
3. The cable insulation layer defect detection method according to claim 2, characterized in that, The process of fusing the spatial features and the channel features using the feature fusion module to form the insulating layer features includes: Using the feature fusion module, spatial features of feature maps at different scales are weighted and fused to form spatial fusion features, and channel features of feature maps at different scales are weighted and fused to form channel fusion features. The spatial fusion features and the channel fusion features are weighted and integrated to form insulating layer features.
4. The cable insulation layer defect detection method according to claim 1, characterized in that, Obtain the defect extraction model, including: An initial defect extraction model is constructed, which includes an initial super-resolution module, an initial multi-scale feature extraction module, an initial attention mechanism module, an initial feature fusion module, and an initial decision layer. A training set consisting of two types of cable insulation training images is obtained. One type of cable insulation training images are images of cable insulation under different environments captured by a high-definition camera. The other type of cable insulation images are images of cable insulation after downsampling, Gaussian noise is added, and homogenization is performed. Each cable insulation training image is labeled with a defect result indicating whether the corresponding cable insulation training image represents an insulation defect. The cable insulation training image corresponding to an insulation defect is also labeled with the defect type and the bounding box used to mark the defect area. Using the initial defect extraction model, the resolution of each cable insulation training image is optimized to form an optimized training image. In each optimized training image, a prediction bounding box is constructed to indicate the defect-related region of the corresponding optimized training image. Based on the region where each prediction bounding box is located, the insulation training features of the corresponding optimized training image are extracted, and the prediction result of the corresponding optimized training image is determined based on the insulation training features. Based on the predicted bounding box, prediction result and corresponding annotation of each optimized training image, the prediction loss of the initial defect extraction model is calculated. Based on each prediction loss, the gradient descent method is used to optimize the initial super-resolution module, the initial multi-scale feature extraction module, the initial attention mechanism module, the initial feature fusion module, and / or the initial decision layer until the prediction loss is lower than the preset loss threshold. The final initial defect extraction model is then used as the defect extraction model.
5. The cable insulation layer defect detection method according to claim 4, characterized in that, The calculation of the prediction loss of the initial defect extraction model based on the predicted bounding box, prediction result, and corresponding annotation of each optimized training image includes: Determine a set of multi-task loss functions that combine bounding box position error function, result error function, and region offset error function; Combining the multi-task loss function set, the prediction loss for each optimized training image is calculated based on the predicted bounding box, prediction result, and corresponding annotation of each optimized training image.
6. A cable insulation layer defect detection device, characterized in that, include: The acquisition module is used to acquire cable insulation layer images, and includes a defect extraction model comprising a super-resolution module, a multi-scale feature extraction module, an attention mechanism module, a feature fusion module, and a decision layer, wherein the super-resolution module is trained to improve the resolution and clarity of the input cable image; The detection module is used to optimize and reconstruct the cable insulation layer image using the super-resolution module to form a super-resolution cable image; to perform stepwise feature extraction and downsampling on the super-resolution cable image using the multi-scale feature extraction module to generate feature maps at different scales; to generate detection boxes for marking detection regions in the super-resolution cable image using the attention mechanism module, and to calculate the spatial attention weights of the feature maps at each scale in each spatial dimension and the channel attention weights of the feature maps at each scale in each channel dimension based on the detection regions, and to calculate the spatial features and channel features of the super-resolution cable image based on each feature map, each spatial attention weight, and each channel attention weight; to fuse the spatial features and the channel features using the feature fusion module to form insulation layer features; and to analyze the similarity between the insulation layer features and various insulation layer defects using the decision layer to evaluate whether there are insulation layer defects in the cable insulation layer image.
7. A cable insulation layer defect detection device, characterized in that, Including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the cable insulation layer defect detection method as described in any one of claims 1-5.
8. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements each step of the cable insulation layer defect detection method as described in any one of claims 1-5.
Citation Information
Patent Citations
Insulator detection network training and detection method and device, and storage medium
CN114841993A
Method for monitoring a power line
US20220146555A1