Insulator defect detection method oriented to complex background
By constructing an insulator defect detection model under complex backgrounds, using SAConv and StripFormer modules to enhance feature perception capabilities, and designing an adaptive SSIoU loss function, the problems of insufficient generalization ability and weak robustness of insulator defect detection in UAV inspections are solved, achieving higher detection accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NORTHEAST DIANLI UNIVERSITY
- Filing Date
- 2026-01-26
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies for insulator defect detection in complex environments suffer from insufficient generalization ability and weak robustness, resulting in low defect recognition rates.
A defect detection model for insulators under complex backgrounds is constructed, including a backbone network, a feature fusion network, and a head network. The SAConv module and the StripFormer module are used to improve the feature perception capability, and an adaptive SSIoU loss function is designed to optimize the detection accuracy.
It improves the accuracy and robustness of insulator defect detection in complex environments, enhances the model's adaptability to insulator defect targets of different scales, and improves the accuracy of locating and detecting irregularly shaped defects.
Smart Images

Figure CN122048838A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence, and more specifically to a method for detecting insulator defects in complex environments. Background Technology
[0002] Insulators, as key components that simultaneously perform electrical insulation and mechanical support functions, directly affect the safety and stability of transmission lines. Insulators, exposed to the outdoor environment for extended periods, inevitably suffer from erosion and impacts from harsh weather and complex environments. Their surfaces gradually accumulate dirt and dust, forming a difficult-to-remove contaminant layer that leads to localized electric field distortion and significantly increases the electric field strength, thereby increasing the risk of flashover. Furthermore, insulators may be subjected to mechanical shocks, ice loads, and quality defects and process deviations during manufacturing, all of which can induce structural defects such as breakage, cracks, or even spontaneous explosion. Once an insulator is damaged or experiences a flashover, its electrical insulation performance will significantly decrease, easily causing short circuits, tripping, or even large-scale power outages. Decreased mechanical strength can also lead to serious consequences such as broken strings, detached parts, or fallen conductors, posing a significant threat to the safe operation of the power grid and the safety of people and property. Therefore, conducting efficient and reliable regular inspections and early defect identification of transmission line insulators is an indispensable and crucial part of building a power system safety monitoring system.
[0003] Currently, most power transmission lines are inspected using drones. However, images of insulator defects collected from the perspective of drones often face obstruction and interference from complex backgrounds such as towers, conductors, and vegetation. The background texture and the appearance features of the insulator overlap, resulting in unclear target boundaries and local details being easily obscured. This leads to existing insulator defect detection models generally having problems such as insufficient generalization ability, weak robustness, and low defect recognition rate in real inspection scenarios. Summary of the Invention
[0004] To address the above problems, this invention proposes a method for detecting insulator defects in complex environments. The technical solution provided by this invention includes the following steps: Step 1: Establish an insulator defect image dataset to form the first dataset; Specifically, in the first dataset, images of insulator defects can be obtained by taking pictures with a high-definition camera mounted on a drone; Step 2: Add annotation information to the images in the first dataset to form the second dataset, and divide the second dataset into training set, validation set and test set in a ratio of 7:3:1; Specifically, in the second dataset, the LabelImg annotation tool was used to add annotation information to the insulator defect images.
[0005] Step 3: Construct an insulator defect detection model for complex backgrounds. The detection model includes a backbone network, a feature fusion network, and a head network. The construction of the insulator defect detection model for complex backgrounds further includes steps 3.1 to 3.4: Step 3.1: The backbone network consists of Conv module 1, Conv module 2, SAConv module 1, Conv module 3, SAConv module 2, Conv module 4, SAConv module 3, Conv module 5, SAConv module 4, SPPF module, and C2PSA module connected in sequence. Step 3.2: The feature fusion network, based on the YOLOv11n neck network, adds two newly designed StripFormer modules 1 and 2, which have the same structure and are used to improve the model's ability to perceive the features of insulators and their defects in complex backgrounds. The StripFormer module has one input, a feature map X. It passes through the MSFI module and the DSPM module to obtain feature maps X1 and X2. Feature map X1 is then processed by the ReLU activation function and Conv module 8. Feature map X2 is processed by the ReLU activation function and Conv module 9. The outputs of Conv module 8 and Conv module 9 are concatenated by the Concat module to obtain feature map X3. Feature map X3 is then processed by Conv module 10 and, together with the original feature map X, is processed by the ReLU activation function to obtain feature map Y. The MSFI module in the StripFormer module has one input, the input feature map X. After being processed by Conv module 11, it passes through Conv module 12, AVGPooling module 1, and AVGPooling module 2 respectively to obtain feature maps X4, X5, and X6. Feature map X5 passes through Conv module 13 and Upsample module 3 in sequence. Feature map X6 passes through Conv module 14 and Upsample module 4 in sequence. The outputs of feature map X4, Upsample module 3, and Upsample module 4 are merged to obtain feature map X1. The DSPM module in the StripFormer module has one input, the input feature map X. After processing by the Conv module 15, it passes through the adaptive horizontal strip pooling module and the adaptive vertical strip pooling module to obtain feature maps X7 and X8, respectively. The adaptive horizontal strip pooling module performs adaptive horizontal pooling on feature map X. The specific operation can be represented as follows: (11), in, This represents the input feature map, which has H rows and W columns; For the output vector, its i-th component That is, the adaptive horizontal strip pooling result of the i-th row; x i,j This represents the activation value in the i-th row and j-th column, where 0 ≤ i <H,0≤j<W;w j It is a non-negative learnable weight vector of length W; The adaptive vertical bar pooling module performs adaptive vertical pooling on the feature map X. The specific operation can be represented as follows: (12) same, For the output vector, its j-th component V represents the adaptive strip pooling result of column j. i It is a non-negative learnable weight vector of length H; Feature map X7 passes through Conv module 16 and Upsample module 5 in sequence; feature map X8 passes through Conv module 17 and Upsample module 6 in sequence; the outputs of Upsample module 5 and Upsample module 6 are combined to obtain feature map X2; Step 3.3: Input the fused features from Step 3.2 into the head network to predict and filter the insulator defect detection results, and obtain the final prediction results of the insulator defect detection, thereby realizing the insulator defect detection. The head network includes three detection heads; Detection head 1 receives the feature map output by C3k2 module 2; detection head 2 receives the feature map output by C3k2 module 3; detection head 3 receives the feature map output by C3k2 module 4. Step 3.4: Adopt the new loss function SSIoU, the formula is: (1), Where η is the shape constraint weight coefficient, Ω shape For shape mismatch loss, distance shape The center offset penalty for shape perception, IoU is calculated between the predicted bounding box B and the ground truth bounding box B. gt The ratio of the intersection area to the union area; In formula (1), the shape mismatch loss Ω shape The calculation formula is: (2), Where θ is the shape-sensitive adjustment factor, ω w It is the target morphology difference factor in the horizontal direction, ω h It is the target morphology difference factor in the vertical direction; In formula (1), the center offset penalty distance for shape perception shape The calculation formula is: (3), Where, x c y c is the center coordinate of the predicted box; c is the diagonal length of the minimum bounding box shared by the predicted box and the ground truth box; In formula (1), the formula for calculating IoU is: (4), In formula (2), ω w ω h The formula is: (5), Where w and h are the horizontal and vertical lengths of the prediction box, respectively. gt ,h gt These are the horizontal and vertical lengths of the ground truth bounding box, respectively; β is the adaptive penalty coefficient; and ww and hh are the weight coefficients for the horizontal and vertical directions of the predicted bounding box, respectively. The formulas for calculating the weighting coefficients ww and hh in the horizontal and vertical directions of the prediction box are as follows: (6), (7), Where scale is the scaling factor; The formula for calculating the adaptive penalty coefficient β is: (8), Where α is the adaptive shape penalty factor, σ is the adaptive threshold, and r is the predicted bounding box shape offset. gt This is the offset of the standard frame shape; In formula (8), r, r gt The calculation formula is: (9), (10) Step 4: Train the insulator defect detection model described in Step 3 for complex backgrounds using the training set and validation set, and save the optimal model. Step 4 further includes steps 4.1 to 4.4: Step 4.1: Set the training parameters of the detection model, including: number of iterations, batch size, optimizer, learning rate, momentum, weight decay, and number of threads; Step 4.2: Input the training set and validation set images and their corresponding labels into the detection model, use the backpropagation algorithm to calculate the gradient of the loss function with respect to the model parameters, and update the model parameters according to the gradient to gradually reduce the loss function; Step 4.3: Monitor the loss function value and performance metrics during the training process. The training ends when the loss function of the training set and validation set no longer decreases, and the evaluation metrics such as accuracy P, recall R, and mean precision mAP no longer improve. Step 4.4: After training is complete, save the optimal model; Step 5: Use a test set to perform accuracy testing on the optimal model to obtain an insulator defect detection model that meets the accuracy requirements. Step 5 further includes steps 5.1 to 5.3: Step 5.1: Input the test set into the optimal model selected in step 4 for testing; Step 5.2: Calculate the model performance metrics: accuracy (P), recall (R), and mean precision (mAP). The specific calculation formulas are as follows: (13) (14) (15) (16) Where P is precision, R is recall, mAP is the mean precision across all classes, AP is the mean precision, m is the number of classes, TP represents the number of positive samples correctly identified as positive samples, FP represents the number of negative samples incorrectly identified as positive samples, and FN represents the number of positive samples incorrectly identified as negative samples. Step 5.3: Evaluate the performance metrics of the test set. If the accuracy of the test set is similar to that of the training set, it means that the model meets the accuracy requirements, and a final insulator defect detection model for complex backgrounds is obtained.
[0006] Compared with the prior art, the beneficial effects of the present invention are: This invention discloses an insulator defect detection method applicable to complex backgrounds. It introduces the SAConv module to construct the backbone network, replacing the original C3k2 module with SAConv to enhance the model's adaptability to insulator defects of different scales in complex backgrounds. A StripFormer module is proposed to construct a feature fusion network, improving the model's feature perception capability for insulators and their defects in complex backgrounds. An SSIoU loss function that adaptively perceives target morphology is designed and applied to improve the accuracy of locating and detecting irregularly shaped insulator defects. Attached Figure Description
[0007] Figure 1 This is a structural diagram of an insulator defect detection model for complex backgrounds according to the present invention; Figure 2 This is a schematic diagram of the StripFormer module structure; Figure 3 This is a schematic diagram of the MSFI module structure; Figure 4 This is a schematic diagram of the DSPM module structure; Detailed Implementation
[0008] To make the technical solution, structural features, achieved objectives, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to specific embodiments and accompanying drawings. It should be noted that the specific embodiments described herein are only for clearer explanation of the present invention and are not intended to limit the present invention.
[0009] The present invention discloses an insulator defect detection method applicable to complex backgrounds, the implementation process of which is as follows: Step 1: Establish an insulator defect image dataset to form the first dataset; Step 2: Add annotation information to the images in the first dataset to form the second dataset, and divide the second dataset into training set, validation set and test set in a ratio of 7:3:1; In this embodiment, in order to better evaluate the detection effect of the insulator defect detection method applicable to complex backgrounds disclosed in this invention, the publicly available dataset IDD insulator defect dataset was used. In this example, the publicly available dataset IDD already contains labeled information. The IDD dataset contains 5000 precisely labeled images, of which 3500 images are used as the training set, 1000 images as the validation set, and 500 images as the test set. Step 3: Construct an insulator defect detection model for complex backgrounds. The detection model includes a backbone network, a feature fusion network, and a head network. The construction of the insulator defect detection model for complex backgrounds further includes steps 3.1 to 3.4: Step 3.1: The backbone network consists of Conv module 1, Conv module 2, SAConv module 1, Conv module 3, SAConv module 2, Conv module 4, SAConv module 3, Conv module 5, SAConv module 4, SPPF module, and C2PSA module connected in sequence. Step 3.2: The feature fusion network, based on the YOLOv11n neck network, adds two newly designed StripFormer modules 1 and 2, which have the same structure and are used to improve the model's ability to perceive the features of insulators and their defects in complex backgrounds. The StripFormer module has one input, a feature map X. It passes through the MSFI module and the DSPM module to obtain feature maps X1 and X2. Feature map X1 is then processed by the ReLU activation function and Conv module 8. Feature map X2 is processed by the ReLU activation function and Conv module 9. The outputs of Conv module 8 and Conv module 9 are concatenated by the Concat module to obtain feature map X3. Feature map X3 is then processed by Conv module 10 and, together with the original feature map X, is processed by the ReLU activation function to obtain feature map Y. The MSFI module in the StripFormer module has one input, the input feature map X. After being processed by Conv module 11, it passes through Conv module 12, AVGPooling module 1, and AVGPooling module 2 respectively to obtain feature maps X4, X5, and X6. Feature map X5 passes through Conv module 13 and Upsample module 3 in sequence. Feature map X6 passes through Conv module 14 and Upsample module 4 in sequence. The outputs of feature map X4, Upsample module 3, and Upsample module 4 are merged to obtain feature map X1. The DSPM module in the StripFormer module has one input, the input feature map X. After processing by the Conv module 15, it passes through the adaptive horizontal strip pooling module and the adaptive vertical strip pooling module to obtain feature maps X7 and X8, respectively. The adaptive horizontal strip pooling module performs adaptive horizontal pooling on feature map X. The specific operation can be represented as follows: (11), in, This represents the input feature map, which has H rows and W columns; For the output vector, its i-th component That is, the adaptive horizontal strip pooling result of the i-th row; x i,j This represents the activation value in the i-th row and j-th column, where 0 ≤ i <H,0≤j<W;w j It is a non-negative learnable weight vector of length W; The adaptive vertical bar pooling module performs adaptive vertical pooling on the feature map X. The specific operation can be represented as follows: (12) same, For the output vector, its j-th component V represents the adaptive strip pooling result of column j. i It is a non-negative learnable weight vector of length H; Feature map X7 passes through Conv module 16 and Upsample module 5 in sequence; feature map X8 passes through Conv module 17 and Upsample module 6 in sequence; the outputs of Upsample module 5 and Upsample module 6 are combined to obtain feature map X2; Step 3.3: Input the fused features from Step 3.2 into the head network to predict and filter the insulator defect detection results, and obtain the final prediction results of the insulator defect detection, thereby realizing the insulator defect detection. The head network includes three detection heads; Detection head 1 receives the feature map output by C3k2 module 2; detection head 2 receives the feature map output by C3k2 module 3; detection head 3 receives the feature map output by C3k2 module 4. Step 3.4: Adopt the new loss function SSIoU, the formula is: (1), Wherein, the shape constraint weight coefficient η=0.5, Ω shape For shape mismatch loss, distance shape The center offset penalty for shape perception, IoU is calculated between the predicted bounding box B and the ground truth bounding box B. gt The ratio of the intersection area to the union area; In formula (1), the shape mismatch loss Ω shape The calculation formula is: (2), Where the shape sensitivity adjustment factor θ=4, ω w It is the target morphology difference factor in the horizontal direction, ω h It is the target morphology difference factor in the vertical direction; In formula (1), the center offset penalty distance for shape perception shape The calculation formula is: (3), Where, x c y c is the center coordinate of the predicted box; c is the diagonal length of the minimum bounding box shared by the predicted box and the ground truth box; In formula (1), the formula for calculating IoU is: (4), In formula (2), ω w ωh The formula is: (5), Where w and h are the horizontal and vertical lengths of the prediction box, respectively. gt ,h gt These are the horizontal and vertical lengths of the ground truth bounding box, respectively; β is the adaptive penalty coefficient; and ww and hh are the weight coefficients for the horizontal and vertical directions of the predicted bounding box, respectively. The formulas for calculating the weighting coefficients ww and hh in the horizontal and vertical directions of the prediction box are as follows: (6), (7), Where the scaling factor is scale=1.2; The formula for calculating the adaptive penalty coefficient β is: (8), Where α is the adaptive shape penalty factor, σ is the adaptive threshold, and r is the predicted bounding box shape offset. gt This is the offset of the standard frame shape; In formula (8), r, r gt The calculation formula is: (9), (10) Step 4: Train the insulator defect detection model described in Step 3 for complex backgrounds using the training set and validation set, and save the optimal model. Step 4 further includes steps 4.1 to 4.4: Step 4.1: Set the training parameters of the detection model, including: number of iterations, batch size, optimizer, learning rate, momentum, weight decay, and number of threads; Step 4.2: Input the training set and validation set images and their corresponding labels into the detection model, use the backpropagation algorithm to calculate the gradient of the loss function with respect to the model parameters, and update the model parameters according to the gradient to gradually reduce the loss function; Step 4.3: Monitor the loss function value and performance metrics during the training process. The training ends when the loss function of the training set and validation set no longer decreases, and the evaluation metrics such as accuracy P, recall R, and mean precision mAP no longer improve. Step 4.4: After training is complete, save the optimal model; Step 5: Use a test set to perform accuracy testing on the optimal model to obtain an insulator defect detection model that meets the accuracy requirements. Step 5 further includes steps 5.1 to 5.3: Step 5.1: Input the test set into the optimal model selected in step 4 for testing; Step 5.2: Calculate the model performance metrics: accuracy (P), recall (R), and mean precision (mAP). The specific calculation formulas are as follows: (13) (14) (15) (16) Where P is precision, R is recall, mAP is the mean precision across all classes, AP is the mean precision, m is the number of classes, TP represents the number of positive samples correctly identified as positive samples, FP represents the number of negative samples incorrectly identified as positive samples, and FN represents the number of positive samples incorrectly identified as negative samples. Step 5.3: Evaluate the performance metrics of the test set. If the accuracy of the test set is similar to that of the training set, it means that the model meets the accuracy requirements, and a final insulator defect detection model for complex backgrounds is obtained.
[0010] In this embodiment, to verify the effectiveness of the detection model of the present invention, YOLOv11n, YOLOv10n, YOLOv8n, YOLOv5, YOLOv11s, SSD, FastR-CNN and the detection model proposed in this invention were tested on the IDD dataset. The evaluation results are shown in Table 1. Among them, the insulator defect detection model proposed in this invention for complex backgrounds outperforms other comparative models in terms of accuracy (P), recall (R), mAP@0.5, and mAP@0.5:0.95. Table 1 Comparison of experimental results
[0011] The above description is merely one embodiment of the present invention and does not limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for detecting insulator defects under complex backgrounds, characterized in that, Specifically, the following steps are included: Step 1: Establish an insulator defect image dataset to form the first dataset; In the first dataset, images of insulator defects can be obtained by taking pictures with a high-definition camera mounted on a drone; Step 2: Add annotation information to the images in the first dataset to form the second dataset, and divide the second dataset into training set, validation set and test set in a ratio of 7:3:1; Step 3: Construct an insulator defect detection model for complex backgrounds. The detection model includes a backbone network, a feature fusion network, and a head network. The construction of the insulator defect detection model for complex backgrounds further includes steps 3.1 to 3.4: Step 3.1: The backbone network consists of Conv module 1, Conv module 2, SAConv module 1, Conv module 3, SAConv module 2, Conv module 4, SAConv module 3, Conv module 5, SAConv module 4, SPPF module, and C2PSA module connected in sequence. The training and validation sets in the second dataset are used as inputs to the backbone network; The backbone network outputs feature information at three different scales through SAConv module 2, SAConv module 3 and C2PSA module respectively; Step 3.2: The feature fusion network, based on the YOLOv11n neck network, adds newly designed StripFormer module 1 and StripFormer module 2; The output of the C2PSA module serves as the input to Upsample module 1 and Concat module 4; The Concat module 1 receives the output from the SAConv module 3 and the Upsample module 1 as input, and then passes through the C3k2 module 1 and the Upsample module 2 in sequence. The Concat module 2 receives the outputs from the SAConv module 2 and the Upsample module 2 as inputs, and then passes through the C3k2 module 2, the StripFormer module 1 and the Conv module 6 in sequence. The Concat module 3 receives the output from the Conv module 6 and the C3k2 module 1 as input, and then passes through the C3k2 module 3, the StripFormer module 2 and the Conv module 7 in sequence. The Concat module 4 receives the outputs from the Conv module 7 and the C2PSA module as inputs, and then passes through the C3k2 module 4 in sequence; Step 3.3: Input the fused features from Step 3.2 into the head network to predict and filter the insulator defect detection results, and obtain the final prediction results of the insulator defect detection, thereby realizing the insulator defect detection. The head network includes three detection heads; Detection head 1 receives the feature map output by C3k2 module 2; detection head 2 receives the feature map output by C3k2 module 3; detection head 3 receives the feature map output by C3k2 module 4. Step 3.4: Adopt the new loss function SSIoU, the formula is: (1), Where η is the shape constraint weight coefficient, Ω shape For shape mismatch loss, distance shape The center offset penalty for shape perception, IoU is calculated between the predicted bounding box B and the ground truth bounding box B. gt The ratio of the intersection area to the union area; In formula (1), the shape mismatch loss Ω shape The calculation formula is: (2), Where θ is the shape-sensitive adjustment factor, ω w It is the target morphology difference factor in the horizontal direction, ω h It is the target morphology difference factor in the vertical direction; In formula (1), the center offset penalty distance for shape perception shape The calculation formula is: (3), Where, x c y c is the center coordinate of the predicted box; c is the diagonal length of the minimum bounding box shared by the predicted box and the ground truth box; In formula (1), the formula for calculating IoU is: (4), In formula (2), ω w ω h The formula is: (5), Where w and h are the horizontal and vertical lengths of the prediction box, respectively. gt ,h gt These are the horizontal and vertical lengths of the ground truth bounding box, respectively; β is the adaptive penalty coefficient; and ww and hh are the weight coefficients for the horizontal and vertical directions of the predicted bounding box, respectively. In formula (5), the weighting coefficients ww and hh of the prediction box in the horizontal and vertical directions are calculated as follows: (6), (7), Where scale is the scaling factor; In formula (5), the adaptive penalty coefficient β is calculated as follows: (8), Where α is the adaptive shape penalty factor, σ is the adaptive threshold, and r is the predicted bounding box shape offset. gt This is the offset of the standard frame shape; In formula (8), r, r gt The calculation formula is: (9), (10), Step 4: Train the insulator defect detection model described in Step 3 for complex backgrounds using the training set and validation set, and save the optimal model. Step 4 further includes steps 4.1 to 4.4: Step 4.1: Set the training parameters of the detection model, including: number of iterations, batch size, optimizer, learning rate, momentum, weight decay, and number of threads; Step 4.2: Input the training set and validation set images and their corresponding labels into the detection model, use the backpropagation algorithm to calculate the gradient of the loss function with respect to the model parameters, and update the model parameters according to the gradient to gradually reduce the loss function; Step 4.3: Monitor the loss function value and performance metrics during the training process. The training ends when the loss function of the training set and validation set no longer decreases, and the evaluation metrics such as accuracy P, recall R, and mean precision mAP no longer improve. Step 4.4: After training is complete, save the optimal model; Step 5: Use the test set to perform accuracy testing on the optimal model in step 4.
4. If the accuracy requirements are met, a final insulator defect detection model for complex backgrounds is obtained.
2. The insulator defect detection method applicable to complex backgrounds according to claim 1, characterized in that, In step 3.2, StripFormer module 1 and StripFormer module 2 have the same structure; The StripFormer module has one input, a feature map X. It passes through the MSFI module and the DSPM module to obtain feature maps X1 and X2. Feature map X1 is then processed by the ReLU activation function and Conv module 8. Feature map X2 is processed by the ReLU activation function and Conv module 9. The outputs of Conv module 8 and Conv module 9 are concatenated by the Concat module to obtain feature map X3. Feature map X3 is then processed by Conv module 10 and, together with the original feature map X, is processed by the ReLU activation function to obtain feature map Y. The MSFI module in the StripFormer module has one input, the input feature map X. After being processed by Conv module 11, it passes through Conv module 12, AVGPooling module 1, and AVGPooling module 2 respectively to obtain feature maps X4, X5, and X6. Feature map X5 passes through Conv module 13 and Upsample module 3 in sequence. Feature map X6 passes through Conv module 14 and Upsample module 4 in sequence. The outputs of feature map X4, Upsample module 3, and Upsample module 4 are merged to obtain feature map X1. The DSPM module in the StripFormer module has one input, the input feature map X. After processing by the Conv module 15, it passes through the adaptive horizontal strip pooling module and the adaptive vertical strip pooling module to obtain feature maps X7 and X8, respectively. The adaptive horizontal strip pooling module performs adaptive horizontal pooling on feature map X. The specific operation can be represented as follows: (11), in, This represents the input feature map, which has H rows and W columns; For the output vector, its i-th component That is, the adaptive horizontal strip pooling result of the i-th row; x i,j This represents the activation value in the i-th row and j-th column, where 0 ≤ i <H,0≤j<W;w j It is a non-negative learnable weight vector of length W; The adaptive vertical bar pooling module performs adaptive vertical pooling on the feature map X. The specific operation can be represented as follows: (12), same, For the output vector, its j-th component V represents the adaptive strip pooling result of column j. i It is a non-negative learnable weight vector of length H; Feature map X7 passes through Conv module 16 and Upsample module 5 in sequence; feature map X8 passes through Conv module 17 and Upsample module 6 in sequence; the outputs of Upsample module 5 and Upsample module 6 are combined to obtain feature map X2.
3. The insulator defect detection method under complex backgrounds according to claim 1, characterized in that, Step 5 further includes steps 5.1 to 5.3: Step 5.1: Input the test set into the optimal model from Step 4 for testing; Step 5.2: Calculate the model performance metrics: accuracy (P), recall (R), and mean precision (mAP). The specific calculation formulas are as follows: (13), (14), (15), (16), Where AP is the average precision, m is the number of classes, TP represents the number of positive samples correctly identified as positive samples, FP represents the number of negative samples incorrectly identified as positive samples, and FN represents the number of positive samples incorrectly identified as negative samples. Step 5.3: Evaluate the performance metrics of the test set. If the accuracy of the test set is similar to that of the training set, it means that the model meets the accuracy requirements, and a final insulator defect detection model for complex backgrounds is obtained.