Insulator defect detection method based on edge guidance and adaptive channel attention
Through the edge feature collaborative fusion module and the adaptive cross-channel attention module, the feature discrimination ability of the insulator defect detection network is enhanced, the problem of insufficient detection accuracy in the existing methods is solved, and more efficient insulator defect detection is achieved.
Patent Information
- Application Number
- CN202510853348.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-10-17
AI Technical Summary
Existing insulator defect detection methods fail to fully capture shallow texture information and fail to effectively utilize potential inter-channel correlations, resulting in reduced detection accuracy.
An insulator defect detection method based on edge guidance and adaptive channel attention is proposed. Through the edge feature collaborative fusion module and the adaptive cross-channel attention module, the network's ability to distinguish defect features is enhanced and feature information redundancy is reduced.
The accuracy and robustness of insulator defect detection are improved, especially in complex background and small target detection.
Smart Images

Figure CN120807414A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer and information technology, in particular to image processing technology, and specifically to an insulator defect detection network based on edge guidance and adaptive channel attention. BACKGROUND
[0002] With the continuous growth of global power demand and the expansion of power transmission networks, the stability and reliability of power grid systems face severe challenges. As a key component that provides isolation and fixation in power transmission lines, insulators are long exposed to harsh environments such as acid rain, wind and sand, and are prone to defects such as cracks, flashover, and aging. These defects not only threaten the normal operation of power transmission lines, but also may cause serious power accidents. Therefore, accurately and efficiently detecting insulator defects is crucial to ensure the safe and reliable operation of power grids.
[0003] In recent years, target detection algorithms based on convolutional neural networks have made significant progress in insulator defect detection. These methods usually improve detection performance by introducing complex network structures and attention mechanisms. However, when insulator defects exhibit significant local gradient changes, existing methods still face challenges. For example, the paper “Small insulator defects detection based on multiscale feature interaction transformer for UAV-assisted power” proposes a small defect detection method based on a multiscale feature interaction network (MFITN), which models the dependency between multiscale features to some extent, improving the detection ability of small targets. However, this method has shortcomings in modeling the potential association between defect edges and regions, making it difficult to effectively distinguish defects from backgrounds, and thus limiting the accurate identification of subtle insulator defects. In addition, existing methods still have shortcomings in feature weight distribution. For example, the paper “MFI-YOLO: multi-fault insulator detection based on an improved YOLOv8” introduces a multiscale attention mechanism to some extent, enhancing the feature weight distribution ability. However, this method only uses a simple addition operation in the feature map fusion stage, lacking an effective feature interaction mechanism, and failing to fully exploit the potential association between channels, resulting in inaccurate feature weight distribution and limiting the performance improvement of the model in complex target detection tasks.
[0004] In order to improve the accuracy of insulator defect detection, an effective dynamic supplementary fusion technology between the defect edge and the region is urgently needed. In addition, most multi-scale channel attention fails to fully exploit the correlation between different channels, which poses new requirements for improving the accuracy of insulator defect detection. SUMMARY
[0005] The purpose of the present application is to solve the technical problem that the insulator defect detection technology based on the detection network fails to fully capture the shallow texture information and fails to fully utilize the potential inter-channel correlation, resulting in reduced detection accuracy of insulator defects, and proposes an insulator defect detection method based on edge guidance and adaptive channel attention.
[0006] To solve the above technical problems, the technical scheme adopted by the present application is: The insulator defect detection method based on edge guidance and adaptive channel attention comprises the following steps: Step S1: preparing an insulator defect dataset; Step S2: combining the edge feature collaborative fusion module ECFM and the adaptive cross-channel attention module ACCA to construct an insulator defect detection method based on edge guidance and adaptive channel attention; Step S3: inputting the insulator defect dataset into the insulator defect detection model based on edge guidance and adaptive channel attention for training, and identifying the insulator defect detection image; Step S4: using the trained model weight to infer the test insulator defect detection image; Step S5: finally outputting the test results of the model.
[0007] In step S2, the insulator defect detection model based on edge guidance and adaptive channel attention is constructed, which includes the Backbone part, the Neck part and the Head part; The Backbone part includes the edge feature collaborative fusion module ECFM; the edge feature collaborative fusion module ECFM captures different scale edge information at the same time, and performs multi-scale feature fusion to associate the potential relationship between the boundary and the region, thereby enhancing the network's ability to distinguish defect features; The Neck part includes the adaptive cross-channel attention mechanism module ACCA, which enhances the network's attention to the insulator defect region in complex background and reduces the redundancy of feature information.
[0008] The edge feature collaborative fusion module ECFM is composed of the Sobel image enhancement module SEIF and the cross-layer multi-source feature fusion module CMSF.
[0009] As Figure 2 shown, wherein the Sobel image enhancement module SEIF is specifically as follows: The insulator image x0 is input, and passes through five branches, branch a0, branch a1, branch a2, branch a3 and branch a4; The output of the insulator image x0 is point multiplied by the output of branch a2 and Filter_x, and then is output by the BN layer . The output of the insulator image x0 is point multiplied by the output of branch a3 and Filter_y, and then is output by the BN layer . Wherein, Filter_x and Filter_y are two 3x3 filters, which are used to detect the edges of the image; Filter_x is used to detect the edge information in the horizontal direction, and Filter_y is used to detect the edge information in the vertical direction, represents the gradient of the input image in the horizontal direction, represents the gradient of the input image in the vertical direction. , The gradient amplitude of the feature map is calculated by the square root formula , and the gradient amplitude is multiplied by the sigmoid function and the insulator image x0 to obtain the feature map G, which is specifically shown in formulas (1) and (2): (1); (2); Wherein is the edge response map, and the gradient amplitude is normalized by applying the Sigmoid activation function to enhance the feature expression ability of the edge region; Next, in order to further refine the edge feature information and realize the complementarity of the edge information and the original image features, the feature map is subjected to Conv1 convolution operation, and the output is subjected to the first ReBn module and is added and fused with the output of the insulator image x0 through branch a0; wherein the ReBn module is a ReLU activation function plus a BN batch normalization; The output of the output of the insulator image x0 through branch a0 is subjected to Conv2 convolution operation, and the output is subjected to the second ReBn module and is added and fused with the output of the insulator image x0 through branch a1 to obtain the final output S0. Specifically as shown in formula (3): (3); wherein, is a ReLU activation function, denotes applying a ReLU activation function to the input features to preserve positive activations and suppress invalid or interfering negative value features, denotes batch normalization, denotes convolution operation, denotes the final feature map obtained after enhancement by the SEIF module.
[0010] As shown in Figure 3 , the cross-layer multi-source feature fusion CMSF module is specifically as follows: The output of the feature map F0 passes through three branches, branches b0, b1 and b2 respectively; The feature map F0 passes through the first convolution module through the branch b0 to obtain the output; The feature map F0 passes through the second convolution module through the branch b1 to obtain the output; The feature map F0 passes through the third convolution module through the branch b2 to obtain the output; The output obtained by passing through the first convolution module through the branch b0 passes through two branches, one of which obtains the feature map F1, and the other obtains the output which is added to the output of the second convolution module to obtain the feature map F2; the output of the second convolution module is added to the output of the third convolution module to obtain the feature map F3; The feature map F1 passes through the fourth convolution module to obtain the feature map F4; the feature map F2 passes through the fifth convolution module to obtain the feature map F5; The feature map F4 passes through the first downsampling module to obtain the feature map F7; the feature map F5 passes through the second downsampling module to obtain the feature map F8; the feature map F3 passes through the third downsampling module to obtain the feature map F6; The feature map F7 is added to the feature map F8 to obtain the output, and the output of the addition operation is added to the feature map F6 to obtain the feature map F9.
[0011] In step S2, as shown in Figure 4 , the adaptive cross-channel attention mechanism module ACCA is specifically as follows: The output of the feature map K0 passes through the sixth convolution module to obtain the feature map K1, the output of the feature map K1 passes through the seventh convolution module to obtain the feature map K2, and the output of the feature map K2 passes through the eighth convolution module to obtain the feature map K3; as shown in formula (4): (4); wherein, denotes convolution with a corresponding convolution kernel size, wherein , the corresponding convolution kernel size is 、 and , in turn, through different size of the convolution kernel to extract feature map Ki from different size of the receptive field, wherein ; In order to extract the global features with stronger discriminative ability, global average pooling is used on the input feature map and the feature map output by each convolution layer; the first spatial dimension GAP module is used on the feature map K1 to obtain channel information ; the second spatial dimension GAP module is used on the feature map K2 to obtain channel information ; the third spatial dimension GAP module is used on the feature map K3 to obtain channel information ; as shown in formula (5): (5) wherein, is the feature value of the corresponding position of the first channel of the feature map after the convolution of the i-th layer of the network, ( ) represents the global average pooling of the c-th channel of the feature map after the convolution of the i-th layer of the network, which converts the feature mapping shape from to , represents the channel descriptor corresponding to the feature of different receptive field, , is the channel information of the feature map K0; In order to realize the dynamic weighted fusion of multi-scale features and global features, the fourth spatial dimension GAP module is used on the feature map K0 to obtain channel information , and then the channel information of the input feature map K0 is transposed to obtain three transposed channel information, respectively , , , so as to broadcast multiplication, the first spatial dimension GAP module is used on the feature map K1 to obtain the output of channel information and the first transposed channel information is multiplied, the second spatial dimension GAP module is used on the feature map K2 to obtain the output of channel information and the second transposed channel information is multiplied, and the third spatial dimension GAP module is used on the feature map K3 to obtain the output of channel information and the third transposed channel information The three results obtained by multiplication are added, and the weight M is finally activated by a Sigmoid function; as shown in formula (6): (6); wherein, represents the inter-channel self-attention map obtained by cross-channel interaction of the multi-scale feature map and the input feature, represents transposing the channel information of the input feature map; represents the channel descriptor corresponding to the feature map Ki, , ; The inter-channel self-attention map is then globally averaged, and a double-branch structure is introduced. One branch models the long-distance dependence between channels to improve the network's ability to perceive global features. The other branch focuses on capturing fine-grained local features. The fifth spatial dimension pooling GAP module is performed on the weight M to obtain first channel information and second channel information. The first channel information is subjected to 1DConv operation, which represents one-dimensional convolution, to generate a first weight. The first weight is activated by a Sigmoid function to obtain a second weight. The second channel information is subjected to a ninth convolution module to halve the number of channels to obtain a third weight. The third weight obtained by halving the number of channels is subjected to a tenth convolution module to restore the number of channels to obtain a fourth weight. as shown in formula (7): (7); wherein, represents channel information with enhanced inter-channel global correlation, represents channel information for capturing local features, represents a global average pooling operation on the weight M, represents a 1D convolution with a convolution kernel of size, represents a 2D convolution with a convolution kernel of size, represents enhanced channel weight information. After global average pooling and one-dimensional convolution are performed on the weight M to extract global channel context information, is obtained by Sigmoid activation function normalization, which is used to enhance the global correlation between channels. To integrate the feature information in different branches, the second weight and the fourth weight are added and fused. The output obtained is activated by a Sigmoid function. The output after the Sigmoid function is multiplied by the feature map K0 after the branch c0, and the output of the multiplication operation is added to the feature map K0 after the branch c1 to obtain the final feature map F*. Specifically as shown in formula (8) (9): (8); (9); Wherein, represents the input feature map, represents the feature map through the module ACCA, refers to the global channel information and the local channel information are added and fused, and the weight obtained after sigmoid activation normalization, represents the global channel information and the local channel information are fused, and the weight obtained after multiplication with the input feature map K0, thereby generating the weighted feature map.
[0012] As shown in Figure 5 , the insulator defect detection model based on edge guidance and adaptive channel attention is constructed as follows: The insulator image is input to the image enhancement SEIF module, and the output of the image enhancement SEIF module is connected with the input of the first cross-layer multi-source feature fusion CMSF module; the output of the first cross-layer multi-source feature fusion CMSF module is connected with the input of the second cross-layer multi-source feature fusion CMSF module, and the output of the second cross-layer multi-source feature fusion CMSF module is connected with the input of the first C3 Module module; the output of the first C3 Module module is connected with the input of the third cross-layer multi-source feature fusion CMSF module, and the output of the third cross-layer multi-source feature fusion CMSF module is connected with the input of the second C3 Module module; the output of the P3 layer of the backbone network is obtained; The output of the second C3 Module module is connected with the input of the fourth cross-layer multi-source feature fusion CMSF module; the output of the fourth cross-layer multi-source feature fusion CMSF module is connected with the input of the third C3 Module module; the output of the P4 layer of the backbone network is obtained; The output of the third C3 Module module is connected with the input of the fifth cross-layer multi-source feature fusion CMSF module; the output of the fifth cross-layer multi-source feature fusion CMSF module is connected with the input of the fourth C3 Module module; the output of the fourth C3 Module module is connected with the input of the SPPF module; the output of the P5 layer of the backbone network is obtained; After the backbone network, the outputs of the P3 layer, the P4 layer and the P5 layer are respectively transmitted to the neck network through branches d0, d1 and d2; The output of the SPPF module is output through the branch d2 after convolution, and then passes through two branches, one branch passes through the branch e1, and one branch passes through the first upsampling operation to obtain the first up-sampling output of the neck network; the first up-sampling output of the neck network is connected with the input of the first adaptive cross-channel attention mechanism module ACCA, and the output of the first adaptive cross-channel attention mechanism module ACCA is subjected to a Concat operation with the output of the P4 layer through the branch d1 to obtain an output; The output obtained by the Concat operation passes through the fifth C3 Module and convolution in sequence, and then passes through two branches, one branch passes through the branch e0, and one branch passes through the second upsampling operation to obtain the second up-sampling output of the neck network; the second up-sampling output of the neck network is connected with the input of the second adaptive cross-channel attention mechanism module ACCA, and the output of the second adaptive cross-channel attention mechanism module ACCA is subjected to a Concat operation with the output of the P3 layer through the branch d0 to obtain an output; The output obtained by the Concat operation passes through the sixth C3 Module, and then passes through two branches, one branch passes through the branch f0, and one branch passes through convolution and the third adaptive cross-channel attention mechanism module ACCA in sequence to obtain an output; the output of the third adaptive cross-channel attention mechanism module ACCA is subjected to a Concat operation with the output through the convolution through the branch e0 to obtain an output; The output obtained by the Concat operation passes through the seventh C3 Module in sequence, and then passes through two branches, one branch passes through the branch f1, and one branch passes through convolution and the third adaptive cross-channel attention mechanism module ACCA in sequence to obtain an output; the output of the fourth adaptive cross-channel attention mechanism module ACCA is subjected to a Concat operation with the output through the convolution through the branch e1 to obtain an output; The output obtained by the Concat operation passes through the eighth C3 Module to obtain an output, the output of the eighth C3 Module passes through the branch f2, and passes through the first Conv2d convolution layer to obtain the final output Z1; the output of the seventh C3 Module passes through the branch f1, and passes through the second Conv2d convolution layer to obtain the final output Z2; the output of the sixth C3 Module passes through the branch f0, and passes through the third Conv2d convolution layer to obtain the final output Z3.
[0013] The step S3 specifically comprises: The insulator defect data set is input into the insulator defect detection model based on edge guidance and adaptive channel attention, and feature extraction, feature fusion and defect recognition are performed. Firstly, the high-frequency information of the insulator image is extracted through the Sobel image enhancement module of edge feature cooperation, and the cross-layer multi-source feature fusion module is combined to enhance the discrimination ability of the network to the defect features, so as to improve the detection precision of small target defects; then, the adaptive cross-channel attention mechanism is used to enhance the attention of the network to the insulator defect area in the complex background, and reduce the redundancy of feature information.
[0014] Step S4 specifically includes: The trained model weight is used to infer the insulator defect detection image in the test set; in the model inference stage, the insulator defect image in the verification set is detected, and the average precision AP and the average precision mean mAP are used as evaluation indexes to measure the detection performance and overall detection effect of the model on different defect categories.
[0015] Step S5 specifically includes: The test results of the model are output, including the detection result image and related evaluation indexes; the detection result image shows the detection of the model on different defect categories of the insulator in the test set, which includes the predicted defect category, the target bounding box and the confidence score; through the visual analysis of the detection effect, the detection performance of the model on small targets, complex backgrounds and shielding conditions can be directly evaluated.
[0016] Compared with the prior art, the present application has the following technical effects: 1) The present application proposes an insulator defect detection method based on edge guidance and adaptive channel attention, which integrates the designed edge feature cooperation module and the adaptive cross-channel attention mechanism module into YOLOv5, enhances the edge information of the insulator, and improves the discrimination ability of the network to the insulator defect features in complex background, so as to cope with the challenge of insulator defect detection in natural complex scenes; 2) The present application proposes an edge feature cooperation fusion module, which captures different scale edge information through the Sobel image enhancement module, introduces a cross-layer multi-source feature fusion module, and performs multi-scale feature fusion to associate the potential relationship between boundaries and regions. The two modules work together to form an edge feature cooperation fusion module, thereby enhancing the discrimination ability of the network to the defect features and improving the detection precision of the network; 3) The present application designs an adaptive cross-channel attention module, which performs cross-channel interaction fusion, realizes the interaction and adaptive weighting between multi-scale features, fully considers the correlation between features, significantly reduces the feature information redundancy, and more effectively allocates feature weights for the detection network. BRIEF DESCRIPTION OF DRAWINGS
[0017] The present application will be further described in conjunction with the drawings and examples: Figure 1This is a flow chart of the insulator defect detection method of the present invention; Figure 2 is a structural diagram of the Sobel image enhancement module (SEIF) of the present invention; Figure 3 2 is a structural diagram of the cross-layer multi-source feature fusion module (CMSF) of the present invention; Figure 4 This is a structural diagram of the adaptive cross-channel attention mechanism module (ACCA) of the present invention; Figure 5 This is the overall framework diagram of the insulator defect detection method based on edge guidance and adaptive channel attention of the present invention. DETAILED DESCRIPTION
[0018] like Figure 1 As shown, an insulator defect detection method based on edge guidance and adaptive channel attention includes the following steps: Step S1: Prepare insulator defect dataset; Step S2: Combining the edge feature collaborative fusion module ECFM and the adaptive cross-channel attention module ACCA, an insulator defect detection method based on edge guidance and adaptive channel attention is constructed; Step S3: input the insulator defect dataset into the insulator defect detection model based on edge guidance and adaptive channel attention for training, and recognize the insulator defect detection image; Step S4: using the trained model weights to perform inference on the test insulator defect detection image; Step S5: Finally, output the test results of the model.
[0019] In step S2, the constructed insulator defect detection model based on edge guidance and adaptive channel attention includes a backbone part, a neck part, and a head part; The backbone includes an edge feature collaborative fusion module (ECFM). This module captures edge information at different scales and fuses multi-scale features to correlate the potential relationship between boundaries and regions, thereby enhancing the network's ability to discriminate defect features. The Neck part includes an adaptive cross-channel attention mechanism module ACCA, which enhances the network's attention to the insulator defect area under complex backgrounds and reduces the redundancy of feature information.
[0020] The edge feature collaborative fusion module ECFM consists of a Sobel image enhancement module SEIF and a cross-layer multi-source feature fusion module CMSF.
[0021] likeFigure 2 As shown in the figure, the Sobel image enhancement module SEIF is specifically as follows: The insulator image x0 is input, and the five branches are branch a0, branch a1, branch a2, branch a3 and branch a4. The output of the insulator image x0 is subjected to a point multiplication operation 203 with the output of branch a2 and Filter_x201, and then subjected to a BN layer 204 to obtain ; The output of the insulator image x0 is subjected to a point multiplication operation 205 with the output of branch a3 and Filter_y202, and then subjected to a BN layer 206 to obtain ; Filter_x201 and Filter_y202 are two 3x3 filters used to detect the edges of the image; Filter_x201 is used to detect the edge information in the horizontal direction, and Filter_y202 is used to detect the edge information in the vertical direction, represents the gradient of the input image in the horizontal direction, represents the gradient of the input image in the vertical direction; , The gradient amplitude of the feature map is calculated by the square root formula , and the gradient amplitude is subjected to a sigmoid function and multiplied by the insulator image x0 to obtain the feature map G207, which is specifically shown in formulas (1) and (2): (1) (2) wherein is an edge response map, and the gradient amplitude is normalized by applying a Sigmoid activation function to enhance the feature expression ability of the edge region; Next, in order to further refine the edge feature information and realize the complementarity of the edge information and the original image features, the feature map 207 is subjected to a Conv1 convolution operation 208, and the output is subjected to a first ReBn module 209 and added and fused 210 with the output of the insulator image x0 through branch a0; wherein the ReBn module is a ReLU activation function plus a BN batch normalization; The output of the added and fused 210 output of the output of the insulator image x0 through branch a0 is subjected to a Conv2 convolution operation 211, and the output is subjected to a second ReBn module 212 and added and fused 213 with the output of the insulator image x0 through branch a1 to obtain the final output S0. Specifically, as shown in equation (3): (3) wherein, is a ReLU activation function, denotes applying a ReLU activation function to the input features to retain positive activations and suppress invalid or interfering negative value features, denotes batch normalization, denotes convolution operation, denotes the final feature map obtained after enhancement by the SEIF module.
[0022] As shown in Figure 3 , wherein the cross-layer multi-source feature fusion CMSF module is specifically as follows: The output of the feature map F0 passes through three branches, namely branch b0, branch b1 and branch b2. The feature map F0 passes through the branch b0 and obtains an output through the first convolution module 301. The feature map F0 passes through the branch b1 and obtains an output through the second convolution module 302. The feature map F0 passes through the branch b2 and obtains an output through the third convolution module 303. The output obtained by passing through the first convolution module 301 through the branch b0 passes through two branches, one of which obtains a feature map F1, and the other branch obtains an output which is added to the output of the second convolution module 302 to obtain a feature map F2; the output of the second convolution module 302 is added to the output of the third convolution module 303 to obtain a feature map F3. The feature map F1 passes through the fourth convolution module 306 to obtain a feature map F4; the feature map F2 passes through the fifth convolution module 307 to obtain a feature map F5. The feature map F4 passes through the first downsampling module 309 to obtain a feature map F7; the feature map F5 passes through the second downsampling module 310 to obtain a feature map F8; the feature map F3 passes through the third downsampling module 308 to obtain a feature map F6. The feature map F7 is added to the feature map F8 to obtain an output, and the output of the addition operation 311 is added to the feature map F6 to obtain a feature map F9.
[0023] In step S2, as shown in Figure 4 , wherein the adaptive cross-channel attention mechanism module ACCA is specifically as follows: The output of the feature map K0 passes through the sixth convolution module 401 to obtain a feature map K1, the output of the feature map K1 passes through the seventh convolution module 403 to obtain a feature map K2, and the output of the feature map K2 passes through the eighth convolution module 405 to obtain a feature map K3; specifically as shown in equation (4): (4) in, represents the convolution of the corresponding convolution kernel size, where , the corresponding convolution kernel sizes are 、 and , sequentially pass through convolution kernels of different sizes to extract feature maps Ki from receptive fields of different sizes, where ; In order to extract global features with stronger discriminative ability, global average pooling is used on the input feature map and the feature map output by each convolution layer; the first spatial dimension pooling GAP module 407 is performed on the feature map K1 to obtain channel information 411; Perform the second spatial dimension pooling GAP module 408 on the feature map K2 to obtain channel information 412; Perform the third spatial dimension pooling GAP module 409 on the feature map K3 to obtain channel information 413; specifically as shown in formula (5): (5) in, For the network The feature map after the convolution layer The corresponding position in the channel The eigenvalues of ( ) represents the global average pooling of the cth channel of the feature map after convolution of the i-th layer of the network, which changes the feature map shape from Convert to , Indicates the channel descriptors corresponding to the features of different receptive fields, , is the channel information of the feature map K0 (400); In order to achieve dynamic weighted fusion of multi-scale features and global features, the feature map K0400 is pooled in the fourth spatial dimension by the GAP module 410 to obtain channel information. , and then input the channel information of feature map K0400 Transpose to obtain three transposed channel information, which are 408, 409, 410, in order to broadcast multiplication, the feature map K1 is pooled in the first spatial dimension by the GAP module 407 to obtain channel information The output and the first transposed channel information 408 multiplication, the second spatial dimension pooling GAP module 408 is performed on the feature map K2 to obtain channel information the output of 413 and the second transposed channel information 409 is multiplied, and the channel information of the third spatial dimension pooling GAP module 409 of the feature map K3 is obtained the output of 414 and the third transposed channel information 410 is multiplied, and the three results are added 418, and finally activated by the Sigmoid function 419 to obtain the weight M 420; as shown in formula (6): (6) wherein, indicates the cross-channel interaction of the multi-scale feature map and the input feature to obtain the inter-channel self-attention map, indicates transposing the channel information of the input feature map; indicates the channel descriptor corresponding to the feature map Ki, , ; The inter-channel self-attention map is then globally averaged pooled, and a double-branch structure is introduced, one branch modeling the long-range dependence between channels to improve the network's ability to perceive global features; the other branch focuses on capturing fine-grained local features; the first channel information 422 and the second channel information 427 are obtained by performing the fifth spatial dimension pooling GAP module 421 on the weight M 413, the first channel information 422 is subjected to 1DConv operation 423, 1DConv represents one-dimensional convolution, to generate the first weight 424, and the first weight 424 obtained is activated by the Sigmoid function 425 to obtain the second weight 426; The second channel information 427 passes through the ninth convolution module 428 to halve the number of channels to obtain the third weight 429, and the third weight 429 obtained by halving the number of channels passes through the tenth convolution module 430 to restore the number of channels to obtain the fourth weight 431; as shown in formula (7): (7) wherein, indicates the channel information with enhanced inter-channel global correlation, indicates the channel information for capturing local features, indicates a global average pooling operation on the weight M, indicates a 1-dimensional convolution with a convolution kernel of size, indicates a 2-dimensional convolution with a convolution kernel of size, It refers to the enhanced channel weight information, and the global average pooling and one-dimensional convolution are performed on the weight M to extract the global channel context information, and then the Sigmoid activation function is used for normalization to obtain the global correlation between channels. In order to integrate the feature information in different branches, the second weight 426 and the fourth weight 431 are added and fused 432, and the output obtained is activated by a Sigmoid function 433. The output of the Sigmoid function 433 is multiplied 434 with the feature map K0 obtained by the branch c0, and the output of the multiplication operation 434 is added 435 with the feature map K0 obtained by the branch c1 to obtain the final feature map F* 436. Specifically, as shown in formulas (8) and (9): (8) (9) Wherein, represents the input feature map, represents the feature map obtained by the module ACCA, refers to the global channel information and the local channel information are added and fused, and the weight obtained by the Sigmoid activation normalization, represents the global channel information and the local channel information are fused, and the weight obtained is multiplied with the input feature map K0, thereby generating a weighted feature map.
[0024] As shown in Figure 5 , the insulator defect detection model based on edge guidance and adaptive channel attention is constructed as follows: The insulator image 100 is input to the image enhancement SEIF module 101, and the output of the image enhancement SEIF module is connected with the input of the first cross-layer multi-source feature fusion CMSF module 102. The output of the first cross-layer multi-source feature fusion CMSF module 102 is connected with the input of the second cross-layer multi-source feature fusion CMSF module 103, and the output of the second cross-layer multi-source feature fusion CMSF module 103 is connected with the input of the first C3 Module module 104. The output of the first C3 Module module 104 is connected with the input of the third cross-layer multi-source feature fusion CMSF module 105, and the output of the third cross-layer multi-source feature fusion CMSF module 105 is connected with the input of the second C3 Module module 106. The output of the P3 layer of the backbone network is obtained. The output of the second C3 Module 106 is connected with the input of the fourth cross-layer multi-source feature fusion CMSF module 107; the output of the fourth cross-layer multi-source feature fusion CMSF module 107 is connected with the input of the third C3 Module 108; the output of the P4 layer of the backbone network is obtained; The output of the third C3 Module 108 is connected with the input of the fifth cross-layer multi-source feature fusion CMSF module 109; the output of the fifth cross-layer multi-source feature fusion CMSF module 109 is connected with the input of the fourth C3 Module 110; the output of the fourth C3 Module 110 is connected with the input of the SPPF module 111; the output of the P5 layer of the backbone network is obtained; After the backbone network, the output of the P3 layer, the output of the P4 layer and the output of the P5 layer are respectively transmitted to the neck network through branches d0, d1 and d2; The output of the SPPF module 111 is transmitted through the branch d2 after the convolution 112, and then transmitted through two branches, one branch is transmitted through the branch e1, and the other branch is transmitted through the first upsampling operation 113 to obtain the output of the first upsampling 113 of the neck network; the output of the first upsampling 113 of the neck network is connected with the input of the first adaptive cross-channel attention mechanism module ACCA, and the output of the first adaptive cross-channel attention mechanism module ACCA is concatenated with the output of the P4 layer through the branch d1 to obtain the output through the Concat operation 115; The output obtained through the Concat operation 115 is sequentially transmitted through the fifth C3 Module 116 and the convolution 117, and then transmitted through two branches, one branch is transmitted through the branch e0, and the other branch is transmitted through the second upsampling operation 118 to obtain the output of the second upsampling 118 of the neck network; the output of the second upsampling 118 of the neck network is connected with the input of the second adaptive cross-channel attention mechanism module ACCA, and the output of the second adaptive cross-channel attention mechanism module ACCA is concatenated with the output of the P3 layer through the branch d0 to obtain the output through the Concat operation 120; The output obtained through the Concat operation 120 is transmitted through the sixth C3 Module 121, and then transmitted through two branches, one branch is transmitted through the branch f0, and the other branch is sequentially transmitted through the convolution 122 and the third adaptive cross-channel attention mechanism module ACCA to obtain the output; the output of the third adaptive cross-channel attention mechanism module ACCA is concatenated with the output transmitted through the convolution 117 through the branch e0 to obtain the output through the Concat operation 124; The output obtained by the Concat operation 124 is sequentially input into a seventh C3 Module 125, and is input into two branches, one branch is input into a branch fl, and the other branch is sequentially input into a convolution 126 and a third adaptive cross-channel attention mechanism module ACCA to obtain an output; the output of the fourth adaptive cross-channel attention mechanism module ACCA and the output obtained by the convolution 112 are input into a branch el, and are input into a Concat operation 128 to obtain an output; The output obtained by the Concat operation 128 is input into an eighth C3 Module 129 to obtain an output, and the output of the eighth C3 Module 129 is input into a branch f2, and is input into a first Conv2d convolution layer 130 to obtain a final output Z1; the output of the seventh C3 Module 125 is input into a branch fl, and is input into a second Conv2d convolution layer 131 to obtain a final output Z2; the output of the sixth C3 Module 121 is input into a branch f0, and is input into a third Conv2d convolution layer 132 to obtain a final output Z3.
[0025] The step S3 specifically comprises: The insulator defect data set is input into the insulator defect detection model based on edge guidance and adaptive channel attention, and feature extraction, feature fusion and defect recognition are performed; First, the high-frequency information of the insulator image is extracted through the Sobel image enhancement module based on edge feature cooperation, and the cross-layer multi-source feature fusion module is combined to enhance the discrimination ability of the network to the defect features, so as to improve the detection precision of small target defects; then, the adaptive cross-channel attention mechanism is used to enhance the attention degree of the network to the insulator defect area in the complex background, and reduce the redundancy of feature information.
[0026] The step S4 specifically comprises: The trained model weight is used to infer the insulator defect detection image in the test set; in the model inference stage, the insulator defect image in the verification set is detected, and the average precision AP and the average precision mean mAP are used as evaluation indexes to measure the detection performance and overall detection effect of the model on different defect categories.
[0027] The step S5 specifically comprises: The test results of the model are output, including a detection result image and related evaluation indexes; the detection result image shows the detection of the model on different defect categories of the insulator in the test set, which includes the predicted defect category, the target bounding box and the confidence score; through visual analysis of the detection effect, the detection performance of the model on small targets, complex backgrounds and occlusion conditions can be directly evaluated.
[0028] Embodiments In order to facilitate those skilled in the art to better understand the present application, further description is as follows: 1) Experimental setup The operating system of the experimental server is Ubuntu 18.04, and the model experiment is carried out on an NVIDIA RTX 3090 (24G) GPU with CUDA version 11.7, and is implemented using the PyTorch framework. During the model training process, the OneCycleLR learning rate scheduler is adopted, and the initial learning rate lr0 and the learning rate reduction factor lrf are both set to 0.01, and the final learning rate is 0.0001. The batch size is set to 8, and the stochastic gradient descent (SGD) optimization algorithm is used, and the momentum value is set to 0.973. In order to minimize the computational overhead on the server side and improve the training efficiency of the model, the input image of the network is adjusted to 640x640. In addition, random rotation and mosaic image enhancement strategies are used to improve the generalization ability of the model. At the same time, the confidence threshold is set to 0.5, and the non-maximum suppression (NMS) threshold is set to 0.45 to improve the accuracy of the detection results. The performance evaluation indicators include average precision (AP), mean average precision (mAP), parameter quantity, GFLOPS and FPS, which measure the single-class detection effect and overall detection performance, respectively, to comprehensively evaluate the performance of the model in the insulator defect detection task.
[0029] 2) Ablation experiment In order to evaluate the effectiveness of each module of the invention, we designed an ablation experiment based on the framework and the proposed innovations, which includes 4 experiments: (1) Base represents the base model. (2) Base + ECFM module. (3) Base + ECFM + SE module. (4) Base + ECFM + ECA module. (5) Base + ECFM + ACCA module.
[0030] Table 1 Ablation experiment results on the insulator defect dataset
[0031] From Table 1, the AP50 of the Base framework on the three types of targets of damaged insulators, normal insulators and flash-fouled insulators is 71.8%, 89.6% and 56.8% respectively, and the mAP is 72.7%, which reflects the basic performance as the benchmark model. After introducing the edge collaborative feature fusion module (ECFM), the AP50 of the three types of targets is increased to 74.8%, 91.3% and 63.0% respectively, and the mAP is increased to 76.4%. This shows that the ECFM module can effectively improve the network's perception ability of target contour and local details, especially in dealing with complex scenes such as fuzzy edges of damaged insulators or flash-fouled insulators, significantly enhancing the robustness and discriminability of feature expression, thereby improving the detection accuracy. Further, after introducing the adaptive cross-channel attention mechanism (ACCA) module, the AP50 of the three types of targets is increased to 76.7%, 91.7% and 64.6% respectively, and the mAP reaches 77.7%. This shows that the ACCA module enhances the expression of key features related to defects by adaptively adjusting the channel weight, suppressing redundant interference, and effectively improving the recognition ability of fine-grained defects, especially in complex scenes such as texture blur and low contrast, thereby optimizing the overall detection performance. When the ECFM and ACCA modules are introduced simultaneously, the model performance reaches the optimal, the AP50 of the three types of targets is increased to 82.9%, 92.3% and 68.1% respectively, and the mAP is increased to 81.1%. Compared with introducing the ECFM or ACCA module alone, the combination of the two can further enhance the network's representation ability of texture information in the defect area, realize more accurate attention and weight distribution of insulator defect-related features, thereby effectively improving the detection performance, verifying the synergistic advantage and effectiveness of the modules proposed in the present application in improving the overall performance of insulator defect detection.
[0032] 3) Comparative experiment To verify the effectiveness of the algorithm of the present application, the performance of the present application and seven excellent detection algorithms is compared, including Faster R-CNN, YOLOv5, YOLOX, Sparse R-CNN, Rtmdet, YOLOv8 and LiteYOLO-ID. In Table 2, we show the average precision (AP), mean average precision (mAP), parameter quantity and FPS test results of these detection algorithms on the insulator defect dataset. The first place is displayed in black bold font.
[0033] Table 2 Comparison results of the method of the present application and each method on the insulator defect dataset
[0034] In the CBIDD dataset, the method of the application has significant improvement in AP50, overall mAP50 and mAP50:95 of three types of insulators compared with LiteYOLO-ID. Among them, compared with LiteYOLO-ID, the AP50 of the three types of insulators is improved by 24.1%, 5.7% and 9.7% respectively, the mAP50 is improved by 13.2%, and the mAP50:95 is improved by 5.5%. The improvement of the method of the application in the broken insulator, mAP50 and mAP50:95 indexes shows that the model has significant advantages in the defect area and precise target positioning. Compared with the region proposal-based method (Sparse R-CNN, Faster R-CNN), the method of the application is improved by 23.2% and 33.4% respectively in the broken insulator, and by 12.3% and 17.4% respectively in the mAP50. Compared with the end-to-end regression method (YOLOv5, YOLOX, YOLOv8), the method of the application is improved by 11.1%, 14.6% and 14.2% respectively in the broken insulator, and by 8.4%, 7.7% and 7% respectively in the mAP50. The experimental comparison results prove that the method of the application exhibits good detection accuracy and model lightweight in the insulator defect detection under complex background, and has more feasibility in the deployment in the actual scene.
[0035] In summary, this paper proposes an insulator defect detection method based on edge guidance and adaptive channel attention on the basis of YOLOv5, designs an edge feature collaborative fusion module, effectively highlights the texture information of the defect area, and introduces adaptive cross-channel attention to realize more accurate weight distribution of the insulator defect related features.
Claims
1. An insulator defect detection method based on edge guidance and adaptive channel attention, characterized in that: The following steps are involved: Step S1: Prepare insulator defect dataset; Step S2: Combining the edge feature collaborative fusion module ECFM and the adaptive cross-channel attention module ACCA, an insulator defect detection method based on edge guidance and adaptive channel attention is constructed; Step S3: input the insulator defect dataset into the insulator defect detection model based on edge guidance and adaptive channel attention for training, and recognize the insulator defect detection image; Step S4: using the trained model weights to perform inference on the test insulator defect detection image; Step S5: Finally, output the test results of the model.
2. The method according to claim 1, characterized in that In step S2, the constructed insulator defect detection model based on edge guidance and adaptive channel attention includes a backbone part, a neck part, and a head part; The backbone includes an edge feature collaborative fusion module (ECFM). This module captures edge information at different scales and fuses multi-scale features to correlate the potential relationship between boundaries and regions, thereby enhancing the network's ability to discriminate defect features. The Neck part includes an adaptive cross-channel attention mechanism module ACCA, which enhances the network's attention to the insulator defect area under complex backgrounds and reduces the redundancy of feature information.
3. The method according to claim 2, characterized in that The edge feature collaborative fusion module ECFM consists of a Sobel image enhancement module SEIF and a cross-layer multi-source feature fusion module CMSF.
4. The method according to claim 3, characterized in that The Sobel image enhancement module SEIF is as follows: Input the insulator image x0 (200) and pass through five branches, namely branch a0, branch a1, branch a2, branch a3, and branch a4; The output of the insulator image x0 (200) is multiplied by the output of branch a2 and Filter_x (201) (203), and then passes through the BN layer (204) to obtain ; The output of the insulator image x0 (200) is multiplied by the output of branch a3 and Filter_y (202) (205), and then passes through the BN layer (206) to obtain ; Among them, Filter_x (201) and Filter_y (202) are two 3x3 filters, which are used to detect the edges of the image; Filter_x (201) is used to detect the edge information in the horizontal direction, and Filter_y (202) is used to detect the edge information in the vertical direction. Represents the gradient of the input image in the horizontal direction, Represents the gradient of the input image in the vertical direction; , The gradient amplitude of the feature map is calculated by the square root formula , gradient amplitude After the sigmoid function is applied and multiplied with the insulator image x0 (200), the feature map G (207) is obtained, as shown in formulas (1) and (2): (1); (2); in is the edge response map, by the gradient amplitude The Sigmoid activation function is applied for normalization to enhance the feature expression ability of the edge area; Next, in order to further refine the edge feature information and realize the complementarity between the edge information and the original image features, the feature map (207) Conv1 convolution operation (208) is performed, and the obtained output is passed through the first ReBn module (209) and added and fused with the output of the insulator image x0 (200) through branch a0 (210); wherein the ReBn module is the ReLU activation function plus BN batch normalization; The output of the insulator image x0 (200) is added and fused through branch a0 (210), and the output is subjected to a Conv2 convolution operation (211). The obtained output is then passed through the second ReBn module (212) and added and fused with the output of the insulator image x0 (200) through branch a1 (213) to obtain the final output S0; Specifically as shown in formula (3): (3); in, is the ReLU activation function, Indicates that the ReLU activation function is applied to the input features to retain positive activation and suppress invalid or interfering negative features. represents batch normalization, represents the convolution operation, It represents the final feature map after being enhanced by the SEIF module.
5. The method according to claim 3, characterized in that The cross-layer multi-source feature fusion CMSF module is as follows: The output of the feature map F0 (300) passes through three branches, namely branch b0, branch b1, and branch b2; The feature map F0 (300) is output through the first convolution module (301) via branch b0; The feature map F0 (300) is output through the second convolution module (302) via branch b1; The feature map F0 (300) is output through the third convolution module (303) via branch b2; The output obtained by passing branch b0 through the first convolution module (301) passes through two branches, one of which obtains a feature map F1, and the output obtained by the other branch is added to the output of the second convolution module (302) (304) to obtain a feature map F2; the output of the second convolution module (302) and the output of the third convolution module (303) are added (305) to obtain a feature map F3; The feature map F1 is passed through the fourth convolution module (306) to obtain the feature map F4; the feature map F2 is passed through the fifth convolution module (307) to obtain the feature map F5; The feature map F4 is passed through the first downsampling module (309) to obtain the feature map F7; the feature map F5 is passed through the second downsampling module (310) to obtain the feature map F8; the feature map F3 is passed through the third downsampling module (308) to obtain the feature map F6; The feature map F7 and the feature map F8 are added together (311) to obtain an output, and the output of the addition operation (311) is added together with the feature map F6 (312) to obtain the feature map F9 (313).
6. The method according to claim 1, characterized in that In step S2, the adaptive cross-channel attention mechanism module ACCA is as follows: The output of the feature map K0 (400) is passed through the sixth convolution module (401) to obtain the feature map K1 (402), the output of the feature map K1 (402) is passed through the seventh convolution module (403) to obtain the feature map K2 (404), and the output of the feature map K2 (404) is passed through the eighth convolution module (405) to obtain the feature map K3 (406); specifically, as shown in formula (4): (4); in, represents the convolution of the corresponding convolution kernel size, where , the corresponding convolution kernel sizes are 、 and , sequentially pass through convolution kernels of different sizes to extract feature maps Ki from receptive fields of different sizes, where ; In order to extract global features with stronger discriminative ability, global average pooling is used on the input feature map and the feature map output by each convolutional layer; the feature map K1 (402) is pooled in the first spatial dimension by the GAP module (407) to obtain channel information (411); Perform the second spatial dimension pooling GAP module (408) on the feature map K2 (404) to obtain channel information (412); Perform the third spatial dimension pooling GAP module (409) on the feature map K3 (406) to obtain channel information (413); specifically as shown in formula (5): (5); in, For the network The feature map after the convolution layer The corresponding position in the channel The eigenvalues of ( ) represents the global average pooling of the cth channel of the feature map after convolution of the i-th layer of the network, which changes the feature map shape from Convert to , Indicates the channel descriptors corresponding to the features of different receptive fields, , is the channel information of the feature map K0 (400); In order to achieve dynamic weighted fusion of multi-scale features and global features, the feature map K0 (400) is subjected to the fourth spatial dimension pooling GAP module (410) to obtain channel information (411), and then the channel information of the input feature map K0 (400) (411) is transposed to obtain three transposed channel information, which are (408), (409), (410), in order to broadcast multiplication, the feature map K1 (402) is pooled in the first spatial dimension by the GAP module (407) to obtain channel information The output of (411) and the first transposed channel information (408) multiply, and perform the second spatial dimension pooling GAP module (408) on the feature map K2 (404) to obtain channel information The output of (413) and the second transposed channel information (409) multiplied, the feature map K3 (406) is pooled in the third spatial dimension by the GAP module (409) to obtain the channel information The output of (414) and the third transposed channel information (410) are multiplied, the three results are added (418), and finally activated by the Sigmoid function (419) to obtain the weight M (420); specifically, as shown in formula (6): (6); in, It represents the inter-channel self-attention map obtained by the cross-channel interaction of the multi-scale feature map and the input feature. Indicates that the channel information of the input feature map is transposed; Refers to the channel descriptor corresponding to the feature map Ki, , ; Subsequently, the inter-channel self-attention map is globally averaged and pooled, and a dual-branch structure is introduced. One branch improves the network's ability to perceive global features by modeling the long-distance dependencies between channels; the other branch focuses on capturing fine-grained local features. The weight M (413) is subjected to a fifth spatial dimension pooling GAP module (421) to obtain first channel information (422) and second channel information (427). The first channel information (422) is subjected to a 1DConv operation (423). 1DConv represents a one-dimensional convolution to generate a first weight (424). The obtained first weight (424) is activated by a Sigmoid function (425) to obtain a second weight (426). The second channel information (427) passes through the ninth convolution module (428), the number of channels is halved to obtain a third weight (429), and the third weight (429) with the number of channels halved is passed through the tenth convolution module (430), the number of channels is restored to obtain a fourth weight (431); Specifically as shown in formula (7): (7); in, It represents the channel information after enhancing the global correlation between channels. It represents the channel information after capturing local features. Indicates a global average pooling operation on the weight M. The convolution kernel is 1D convolution of size , The convolution kernel is 2D convolution of size, Refers to the enhanced channel weight information, which is obtained by performing global average pooling and one-dimensional convolution on the weight M to extract global channel context information, and then normalized by the Sigmoid activation function to enhance the global correlation between channels; In order to integrate the feature information in different branches, the second weight (426) and the fourth weight (431) are added and fused (432), and the obtained output is activated by the Sigmoid function (433). The output of the Sigmoid function (433) and the feature map K0 (400) passing through the branch c0 are multiplied (434). The output of the multiplication operation (434) and the feature map K0 (400) passing through the branch c1 are added (435) to obtain the final feature map F* (436). Specifically, as shown in formulas (8) and (9): (8); (9); in, represents the input feature map, represents the feature graph passed through the module ACCA, Refers to global channel information With local channel information Add and fuse, and perform sigmoid activation normalization to obtain the weights. Represents global channel information With local channel information The weight obtained after fusion is multiplied by the input feature map K0 to generate a weighted feature map.
7. According to the method of any one of claims 1 to 6, the insulator defect detection model based on edge guidance and adaptive channel attention is constructed as follows: The insulator image (100) is input to the image enhancement SEIF module (101), and the output of the image enhancement SEIF module (101) is connected to the input of the first cross-layer multi-source feature fusion CMSF module (102); the output of the first cross-layer multi-source feature fusion CMSF module (102) is connected to the input of the second cross-layer multi-source feature fusion CMSF module (103), and the output of the second cross-layer multi-source feature fusion CMSF module (103) is connected to the input of the first C3 Module module (104); the output of the first C3 Module module (104) is connected to the input of the third cross-layer multi-source feature fusion CMSF module (105), and the output of the third cross-layer multi-source feature fusion CMSF module (105) is connected to the input of the second C3 Module module (106); the output of the P3 layer of the backbone network is obtained; The output of the second C3 Module (106) is connected to the input of the fourth cross-layer multi-source feature fusion CMSF module (107); the output of the fourth cross-layer multi-source feature fusion CMSF module (107) is connected to the input of the third C3 Module (108); the output of the P4 layer of the backbone network is obtained; The output of the third C3 Module (108) is connected to the input of the fifth cross-layer multi-source feature fusion CMSF module (109); the output of the fifth cross-layer multi-source feature fusion CMSF module (109) is connected to the input of the fourth C3 Module (110); the output of the fourth C3 Module (110) is connected to the input of the SPPF module (111); and the output of the P5 layer of the backbone network is obtained; After the backBone network, the output of the P3 layer, the output of the P4 layer, and the output of the P5 layer are passed to the neck network through branches d0, d1, and d2 respectively; The output of the SPPF module (111) passes through branch d2 and undergoes convolution (112), and then passes through two branches, one branch passing through branch e1 and the other branch passing through the first upsampling operation (113) to obtain the output of the first upsampling (113) of the neck network; The output of the first upsampling (113) of the neck network is connected to the input of the first adaptive cross-channel attention mechanism module ACCA (114), and the output of the first adaptive cross-channel attention mechanism module ACCA (114) is concat-operated with the output of the P4 layer through the branch d1 (115) to obtain the output; The output obtained by the Concat operation (115) passes through the fifth C3 Module (116) and the convolution (117) in sequence, and then passes through two branches, one branch passing through branch e0 and the other branch passing through the second upsampling operation (118) to obtain the output of the second upsampling (118) of the neck network; The output of the second upsampling (118) of the neck network is connected to the input of the second adaptive cross-channel attention mechanism module ACCA (119), and the output of the second adaptive cross-channel attention mechanism module ACCA (119) is concat-operated with the output of the P3 layer through the branch d0 (120) to obtain the output; The output obtained by the concat operation (120) passes through the sixth C3 Module module (121), passes through two branches, one branch passes through branch f0, and the other branch passes through convolution (122) and the third adaptive cross-channel attention mechanism module ACCA (123) in sequence to obtain the output; the output of the third adaptive cross-channel attention mechanism module ACCA (123) and the output after convolution (117) are concat-operated (124) through branch e0 to obtain the output; The output obtained by the Concat operation (124) passes through the seventh C3 Module (125) in sequence, and then passes through two branches, one branch passes through branch f1, and the other branch passes through convolution (126) and the third adaptive cross-channel attention mechanism module ACCA (127) in sequence to obtain the output; The output of the fourth adaptive cross-channel attention mechanism module ACCA (127) and the output after convolution (112) are concat-operated (128) through branch e1 to obtain the output; The output of the Concat operation (128) is output through the eighth C3 Module module (129), and the output of the eighth C3 Module module (129) is output through the branch f2 and the first Conv2d convolution layer (130) to obtain the final output Z1; The output of the seventh C3Module module (125) passes through branch f1 and the second Conv2d convolutional layer (131) to obtain the final output Z2; The output of the sixth C3 Module (121) passes through branch f0 and the third Conv2d convolutional layer (132) to obtain the final output Z3.
8. The method according to claim 7, characterized in that Step S3 specifically includes: The insulator defect dataset is input into the insulator defect detection model based on edge guidance and adaptive channel attention for feature extraction, feature fusion and defect identification. Firstly, a Sobel image enhancement module with coordinated edge features is used to extract high-frequency information of insulator images. Then, a cross-layer multi-source feature fusion module is combined to enhance the network's ability to discriminate defect features, thereby improving the detection accuracy of small target defects. Subsequently, an adaptive cross-channel attention mechanism is used to enhance the network's attention to insulator defect areas in complex backgrounds and reduce the redundancy of feature information.
9. The method according to claim 7, characterized in that Step S4 specifically includes: The trained model weights are used to infer the insulator defect detection images in the test set. During the model inference stage, the insulator defect images in the validation set are detected, and the average precision (AP) and mean average precision (mAP) are used as evaluation indicators to measure the detection performance of the model on different defect categories and the overall detection effect.
10. The method according to claim 7, 8 or 9, characterized in that: Step S5 specifically includes: The test results of the output model include a detection result graph and related evaluation indicators. The detection result graph shows the model's detection of different defect categories on insulators in the test set, including the predicted defect category, target bounding box, and confidence score. Through visual analysis of the detection effect, the model's detection performance for small targets, complex backgrounds, and occlusion can be intuitively evaluated.