An Insulator Defect Detection Method Based on Improved YOLOv11n

By improving the YOLOv11n model and combining multi-scale dilated convolution, enhanced CBAM, and Coord Attention mechanisms, the problem of insufficient receptive field expansion capability of the YOLOv11 architecture in insulator defect detection is solved, achieving high-precision and high-recall insulator defect detection.

CN122492579APending Publication Date: 2026-07-31KUNMING UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
KUNMING UNIVERSITY
Filing Date
2026-04-21
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

The existing YOLOv11 architecture has limited receptive field expansion capability in insulator defect detection, making it difficult to adaptively cover defects of all scales. This leads to the degradation of weak defect features in the early extraction stage, affecting the localization accuracy and recall rate of subsequent modules.

Method used

The original C3k2 structure is replaced by the MSDA-C2f feature extraction module, which includes multi-scale dilated convolution, enhanced CBAM mechanism and Coord Attention mechanism, to build an improved YOLOv11n model. The detection accuracy and recall are improved through data preprocessing and model training.

Benefits of technology

It improves the overall accuracy and multi-scale localization capability of insulator defect detection, achieves a balance between precision and recall, enhances the model's generalization ability to defects of different scales, effectively suppresses background interference, and improves the robustness of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122492579A_ABST
    Figure CN122492579A_ABST
Patent Text Reader

Abstract

This invention discloses an insulator defect detection method based on an improved YOLOv11n, belonging to the interdisciplinary technical field of intelligent power equipment inspection and computer vision. The method comprises the following steps: S1, data acquisition and preprocessing; S2, constructing an improved YOLOv11n network model; S3, feature residual fusion and model training; and S4, outputting the insulator defect prediction results and bounding boxes. This invention utilizes the MSDA-C2f feature extraction module, which includes multi-scale dilated convolution, enhanced CBAM mechanism, and Coord Attention mechanism. This enables the improved YOLOv11n model to achieve high overall detection accuracy in insulator defect detection. The MSDA-C2f module improves the localization accuracy under high IoU thresholds, effectively enhancing the model's generalization adaptability to defects of different scales.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the interdisciplinary field of intelligent inspection of power equipment and computer vision, specifically to an insulator defect detection method based on an improved YOLOv11n. Background Technology

[0002] Insulators, as key components in high-voltage transmission lines, serve dual functions of electrical isolation and mechanical support, and their operational status directly affects the safety and stability of the power grid. During long-term outdoor service, insulators are prone to defects such as micro-cracks and glaze peeling due to factors such as electric field stress and changes in temperature and humidity. In power line inspection using drones, there are significant challenges and difficulties, including the difficulty in identifying small targets and severe interference from irregular shapes and complex backgrounds (such as the sky, vegetation, and hardware reflections).

[0003] The existing YOLOv11 architecture has limitations when dealing with extremely fine-grained tasks with dense small targets. The receptive field expansion capability of its C3k2 module is limited by the fixed convolutional kernel size, making it difficult to adaptively cover defects across the entire scale. This makes weak defect features prone to degradation in the early extraction stage, resulting in subsequent modules being unable to effectively compensate for them. Summary of the Invention

[0004] To address or partially address the problems existing in related technologies, this invention provides an insulator defect detection method based on an improved YOLOv11n. This method can improve overall detection accuracy, enhance multi-scale defect localization and generalization capabilities, and achieve a better balance between precision and recall.

[0005] To achieve the above objectives, the technical solution of the present invention is as follows: An insulator defect detection method based on the improved YOLOv11n is provided, the innovation of which lies in the following steps: S1. Data Acquisition and Preprocessing: Collect visible light images from UAV inspections, manually annotate insulator defects in the images to obtain image datasets, preprocess the image data, and construct training and test sets according to preset ratios. S2. Construct an improved YOLOv11n network model: In the YOLOv11n backbone network, replace the original C3k2 structure with the MSDA-C2f feature extraction module. The MSDA-C2f feature extraction module includes multi-scale dilated convolution, enhanced CBAM mechanism and Coord Attention mechanism; and output coordinate attention features through the Coord Attention mechanism. S3. Model Training: The Improved YOLOv11n model is trained and evaluated using the training and test sets obtained in S1 to obtain a trained model. S4. Output insulator defect prediction results and bounding boxes: The insulator inspection images collected in real time by the UAV are used as input data and fed into the trained Improved YOLOv11n model. The model outputs the predicted category, confidence level and bounding box location of the insulator defects, realizing automated fault early warning.

[0006] Preferably, in S1, the image dataset includes defect bounding box coordinates and category labels, wherein the categories include microcracks and damage.

[0007] Preferably, in S1, the preprocessing includes data cleaning, enhancement operations, and normalization processing. Data cleaning uses a contrast-limited adaptive histogram equalization algorithm to perform local illumination cleaning on the original image, increasing the high-frequency contrast between the edge of the insulator skirt and the microcracks. The enhancement operation is to address the imbalance in the proportion of extremely small-scale crack samples in the dataset by setting directional cropping and Mosaic splicing enhancement based on the physical contour of the insulator.

[0008] Preferably, in S2, the MSDA-C2f feature extraction module inputs the feature map as follows: Channel dimension mapping is achieved through 1×1 convolution, unifying it to the target number of channels. And retain this feature map as a backup feature for the residual connection. .

[0009] Preferably, in S2, the multi-scale dilated convolution is a four-branch parallel process, and the dilation rate of the parallel convolution is... The asymmetric exponential gradient is set to [1,2,4,8]. Adaptive fusion of four branches constructs a scale-complete basic feature subspace for subsequent attention modulation. The feature extraction formula for road branches is: In the formula Indicates the first The original feature map output by the path branch; This is a dilated convolution operation; The kernel size; No. The expansion rate of road branches; The backup features for residual connections are obtained through 1×1 convolution: =Conv 1×1 (X); Introducing learnable fusion weights The four features are weighted, concatenated, and compressed. The initial fusion features are output after fusion. : In the formula, For the first The feature map after weighting by the road; The Sigmoid activation function compresses the weight values ​​to the [0,1] interval. For the first The learnable adaptive weight scalars of the path are obtained through network training; This is the tensor after splicing the four features; This is a splicing operation along the channel dimension; Batch Size; The target number of channels after unification. This refers to the number of channels after splicing, which is 4 channels × each channel. aisle; The height of the feature map; The width of the feature map; This is the fused feature map; Conv 1×1 It is a 1×1 convolution used for channel dimensionality reduction; The number of channels in the formula is from descend ; Indicates the dimension shape as The real tensor space.

[0010] Preferably, in S2, the enhanced CBAM mechanism can suppress complex backgrounds by introducing a learnable residual scaling parameter initialized to 0. The formula is: In the formula, The feature map output by the Enhanced CBAM module. The learnable residual scaling parameter is initialized to 0; The fused feature map; Channel attention; Spatial attention; This represents the number of channels in the feature map.

[0011] Preferably, in S2, the specific process of the Coord Attention mechanism is to process the input features... One-dimensional adaptive average pooling is performed along the horizontal and vertical directions: In the formula, Features obtained after pooling along the vertical direction; The features are obtained after pooling along the vertical horizontal direction; For adaptive two-dimensional average pooling; This indicates the output dimensions: the height remains the same, but the width is compressed to 1. For output dimensions: height is compressed to 1, width remains unchanged; Perform dimensionality reduction, activation, and dimensionality increase transformations to generate a directional attention map: In the formula, This is a vertical attention weight map; This is a horizontal attention weighting map; To reduce the number of channels from C to r×C 1×1 convolution, where r is the compression ratio; To increase the number of channels from r×C to C using a 1×1 convolution; To modify the activation function of the linear unit; For batch normalization; Final output coordinate attention features: In the formula, This is the final feature map output by the coordinate attention module.

[0012] Preferably, in S3, before model training, the coordinate attention features are added to the initial backup features via residual connections: In the formula, Y represents the result of the residual connection and is the final output of the MSDA-C2f module.

[0013] Preferably, in S3, the model training process includes: iteratively training the Improved YOLOv11n model using the training set constructed in S1; during the training process, calculating the loss value between the prediction result and the true label, optimizing the network parameters through the backpropagation algorithm until the loss function converges to a stable state, saving the optimal model weights, and after training is completed, testing and evaluating the model based on the optimal model weights using the test set.

[0014] Preferably, in S3, during the initial stage of model training... The value is 0, primarily using identity mapping to avoid subtle gradient vanishing. As training progresses, The loss function is adaptively increased gradually until it converges to a stable state and then stops increasing. The optimal value has been achieved.

[0015] This invention provides an insulator defect detection method based on an improved YOLOv11n, which has the following advantages: (1) The present invention is based on the MSDA-C2f feature extraction module, which includes multi-scale dilated convolution, enhanced CBAM mechanism and Coord Attention mechanism, so that the improved YOLOv11n model has high overall detection accuracy when detecting insulator defects. The MSDA-C2f module improves the localization accuracy under high IoU threshold and effectively enhances the model's generalization and adaptation ability to defects of different scales.

[0016] (2) Better balance between precision and recall: The model of this invention has a high recall rate and can achieve a high precision rate by effectively suppressing background interference. This proves that the present invention has better discrimination ability while maintaining the feature of insulator defects at the smallest scale.

[0017] (3) The MSDA-C2f constructed in this invention forms a collaborative closed loop of multi-scale perception, saliency filtering, and geometric reshaping. The four-branch dilated convolution constructs a feature manifold covering the entire scale of insulators from "micro-cracks to large-area glaze delamination"; and it is tightly coupled with the Enhanced CBAM mechanism to perform "saliency filtering" from the global dimensions of channels and space, purifying the defect signal-to-noise ratio, and its adaptive residual parameters This approach perfectly overcomes the industry-wide challenge of conventional attention leading to the vanishing of weak crack gradients in the early stages of training. Furthermore, addressing the limitation of global pooling in accurately representing crack topological orientation, Coord Attention is introduced at the end, decoupling features to orthogonal horizontal and vertical coordinate systems, thus achieving precise reshaping of geometric orientation information. These three elements modulate features from three orthogonal dimensions: receptive field scale, global saliency, and local orientation, forming an inseparable complementary enhancement network that achieves super-stacking effects. Attached Figure Description

[0018] Figure 1 This is a flowchart of the insulator defect detection method based on the improved YOLOv11n in this invention.

[0019] Figure 2 This is a schematic diagram of the MSDA-C2f feature extraction module in this invention.

[0020] Figure 3 This is a schematic diagram of the Enhanced CBAM and Coord Attention mechanism in this invention.

[0021] Figure 4 This is a schematic diagram of the overall network architecture of Improved YOLOv11n in this invention.

[0022] Figure 5 This is a thermodynamic comparison diagram of insulator defect detection between the improved model and the baseline model in this invention. Detailed Implementation

[0023] The present invention will be further described in detail below with reference to specific embodiments and accompanying drawings, but the scope of protection of the present invention is not limited to the content described.

[0024] This invention proposes an insulator defect detection method based on an improved YOLOv11n, and designs and applies the MSDA-C2f module to replace the original C3k2 structure. Combined with... Figure 1 The method flowchart shown illustrates the specific implementation steps of this invention as follows: S1. Data Acquisition and Preprocessing: Collect visible light images from UAV inspections, manually annotate insulator defects in the images to obtain image datasets, preprocess the image data, and construct training and test sets according to preset ratios. Defects (microcracks, breakage) in images are manually annotated, generating an annotation file containing defect bounding box coordinates and category labels. High-quality, high signal-to-noise ratio input data is provided, with particular enhancement of high-frequency features of microcracks.

[0025] Because insulators are often exposed to complex outdoor environments such as strong backlighting or low illumination, microcrack features are easily confused with the background. Therefore, this invention does not use conventional uniform normalization in the image preprocessing stage, but instead introduces targeted data cleaning and enhancement operations: first, the Limit Contrast Adaptive Histogram Equalization (CLAHE) algorithm is used to perform local illumination cleaning (data cleaning) on ​​the original image, increasing the high-frequency contrast between the insulator skirt edge and the microcrack.

[0026] Secondly, to address the imbalance in the proportion of extremely small-scale crack samples in the dataset, a method based on directional cropping and Mosaic splicing enhancement using the physical contour of the insulator was designed.

[0027] The above data cleaning and enhancement operations not only remove invalid background redundancy, but also provide a high-quality data source with high signal-to-noise ratio and balanced low-frequency and high-frequency features for the multi-scale dilated convolution of the MSDA-C2f module in subsequent steps (especially for dilation rate branches 1 and 2 for small features), enabling the network to quickly focus on real defects rather than light and shadow interference.

[0028] S2. Construct an improved YOLOv11n network model that includes the MSDA-C2f module. In the YOLOv11n backbone network, the original C3k2 structure is replaced by a novel MSDA-C2f feature extraction module. This module includes multi-scale dilated convolution, enhanced CBAM mechanism, and Coord Attention mechanism.

[0029] The MSDA-C2f feature extraction module inputs the feature map as follows: Channel dimension mapping is achieved through 1×1 convolution, unifying it to the target number of channels. And retain this feature map as a backup feature for the residual connection. .

[0030] Its specific feature extraction and attention modulation process includes the following three sub-stages: S2.1 Multi-scale dilated convolution branch (four branches in parallel) Traditional single-scale convolution or pooling operations often face contradictions when processing insulator defects, such as "micro-cracks are easily smoothed out" or "large-scale damage features are incomplete." This embodiment overcomes the computational bottleneck of conventional feature pyramids by expanding the dilation rate of parallel convolution branches. The asymmetric exponential gradient is set to [1,2,4,8]. This design is highly isomorphic to the real physical priors of insulator defects: the low expansion rate (1, 2) branch acts as a "high-frequency detail capturer," dedicated to maintaining pixel-level resolution for microcracks; the high expansion rate (4, 8) branch acts as a "low-frequency semantic perceptron," acquiring a global receptive field sufficient to cover large-scale deglazing or breakage at extremely low parameter cost. The adaptive fusion of the four branches constructs a scale-complete basic feature subspace for subsequent attention modulation. The structural diagram of the feature extraction module is shown below. Figure 2 As shown. (The following is a list of numbers / items / etc.) The feature extraction formula for road branches is: In the formula Indicates the first The original feature map output by the path branch; v represents the dilated convolution (dilated convolution) operation; The kernel size; No. The expansion rate of road branches; The backup features for residual connections are obtained through 1×1 convolution: =Conv 1×1 (X).

[0031] Introducing learnable fusion weights The four features are weighted, concatenated, and compressed. The initial fusion features are output after fusion. : In the formula, For the first The feature map after weighting by the road; The Sigmoid activation function compresses the weight values ​​to the [0,1] interval. For the first The learnable adaptive weights (scalars) of the path are obtained through network training; This is the tensor after splicing the four features; This is a splicing operation along the channel dimension; Batch Size; The target number of channels after unification. That is, the number of channels after splicing (4 channels × each channel) aisle); The height of the feature map; The width of the feature map; This is the fused feature map; Conv 1×1 for Convolution is used for channel reduction. The number of channels in the formula is from descend ; Indicates the dimension shape as The real tensor space.

[0032] S2.2. Applying the enhanced CBAM mechanism to suppress complex backgrounds: While multi-scale dilated convolution captures defects at all scales, it inevitably maps complex inspection backgrounds, including specular reflections and canopy textures, to a high-dimensional feature space. To address this feature redundancy issue, this step works closely with the preceding multi-scale module, introducing Enhanced CBAM for "saliency purification" of features.

[0033] The initial feature response of microcracks in insulators is extremely weak, and conventional static attention mechanisms are prone to misclassifying them as background noise and over-suppressing them during the early stages of training. Therefore, this invention introduces a learnable residual scaling parameter initialized to 0. This mechanism allows the network to primarily use identity mappings in the early stages of training, protecting weak and flawed features from being successfully propagated across layers; as training progresses, Adaptive optimization smoothly activates the dual suppression capabilities of the channel and space, achieving a dynamic optimal balance between defect feature preservation and background noise filtering. Based on this theory, specific... Enhanced CBAM modulation was performed, and channel attention was calculated using averaging and max pooling, respectively. and spatial attention : First, feature dependencies along the channel dimension are captured using global average pooling (AdaptiveAvgPool2d) and global max pooling (AdaptiveMaxPool2d), respectively, with the input features being... Calculate channel attention The formula is: Secondly, computational spatial attention The formula is: In the formula, The average pooling output for channel attention; The maximum pooling output represents the channel attention; MLP stands for Multilayer Perceptron. The average pooling output for spatial attention; The number of channels in the feature map; This is the feature map of the c-th channel, where c is the channel index; This is a spatial max-pooling feature map; To take the maximum value along the channel dimension; For step-by-step fusion features Spatial attention map; It is a 7×7 convolutional layer.

[0034] Introducing learnable residual scaling parameters Output attention features : In the formula, The feature map output by the Enhanced CBAM module. The learnable residual scaling parameter (scalar) is initialized to 0. In the early stages of model training, identity mapping is the primary method to avoid vanishing gradients due to weak defects.

[0035] S2.3, Enhance orientation awareness by applying coordinate attention mechanism While the features filtered by Enhanced CBAM possess extremely high target saliency, conventional global pooling operations can obscure the crucial geometric orientation and spatial topological relationship of insulator cracks during dimensionality reduction. To achieve a logical closed loop for feature modulation, this invention cascades a Coord Attention mechanism at the end of the module. This mechanism, through decoupled one-dimensional adaptive pooling, aggregates features along the horizontal and vertical coordinate axes respectively, not only recaptures the two-dimensional spatial location information weakened by global operations but also accurately encodes the coordinates of the "direction sensitivity" of insulator skirt edges and slender cracks. This cascaded strategy of "global saliency filtering first, followed by local orientation reshaping" results in a final output feature tensor with both strong resistance to background interference and extremely high boundary localization accuracy. In specific implementation, the input features are... One-dimensional adaptive average pooling is performed along the horizontal and vertical directions: In the formula, Features obtained after pooling along the vertical direction; The features are obtained after pooling along the vertical horizontal direction; For adaptive two-dimensional average pooling; This indicates the output dimensions: the height remains the same, but the width is compressed to 1. Output dimensions: height compressed to 1, width unchanged.

[0036] Perform dimensionality reduction, activation, and dimensionality increase transformations to generate a directional attention map: In the formula, This is a vertical attention weight map; This is a horizontal attention weighting map; To reduce the number of channels from C to r×C 1×1 convolution, where r is the compression ratio; To increase the number of channels from r×C to C using a 1×1 convolution; To modify the activation function of the linear unit; For batch normalization.

[0037] Final output coordinate attention features: In the formula, This is the final feature map output by the coordinate attention module.

[0038] The schematic diagram of the Enhanced CBAM and Coord Attention mechanism in this invention is shown below. Figure 3 As shown, Figure 3The diagrams illustrate the flow structures of Channel Attention and Spatial Attention, as well as the mechanism structure of Enhanced CBAM based on Channel Attention and Spatial Attention. The rightmost diagram shows the Coord Attention mechanism structure.

[0039] Combination Figure 2 Schematic diagram of the MSDA-C2f feature extraction module structure and Figure 3 As can be seen from the internal structure of the attention mechanism, the feature transfer process designed in this invention is not a linear transfer of channels, but rather undergoes a complex nonlinear mapping mechanism of "multi-dimensional feature decoupling-adaptive modulation-reconstruction". Specifically, the input feature tensor is first decoupled in the channel dimension and enters physical branches with different receptive field gradients for independent computation; subsequently, the heterogeneous features of each branch are not simply added together, but adaptive fusion weights are generated by establishing cross-dimensional mapping relationships. This achieves dynamic recombination of features at the pixel level. In the feature cleanup stage after recombination, such as... Figure 3 As shown, the feature tensor is forcibly split into a "channel-space" dual-path parallel network for squeezing and excitation, and finally decoupled... and One-dimensional adaptive pooling compresses high-dimensional features into orthogonal geometric directions for encoding. This sophisticated tensor partitioning and reconstruction mechanism ensures that the weak gradient information of extremely small targets is preserved in deep networks.

[0040] S3. Perform feature residual fusion and model training. At the end of the MSDA-C2f module, the coordinate attention-modulated features are added to the initial backup features via residual connections to alleviate the gradient vanishing problem in deep networks and ensure that small defect features do not degrade. In the formula, Y represents the result of the residual connection and is the final output of the MSDA-C2f module.

[0041] After replacing the C3k2 structure with the MSDA-C2f module obtained from S2, the improved YOLOv11n model obtained after the replacement is trained. Figure 4 This is a schematic diagram of the overall network architecture of Improved YOLOv11n in this invention.

[0042] The improved YOLOv11n model was trained iteratively multiple times using the training set constructed with S1. During training, the loss value between the predicted results and the ground truth labels was calculated, and the network parameters were optimized using the backpropagation algorithm until the loss function converged to a stable state. The optimal model weights were saved, and after training, the model was tested and evaluated using the test set based on the optimal model weights. In the early stages of model training... The initial value is 0, primarily using identity mapping to avoid gradient vanishing due to weak defects. As training progresses, γ adaptively increases gradually until it stops increasing when the loss function converges to a stable state. The optimal value has been achieved.

[0043] S4. Output insulator defect prediction results and bounding box In practical applications, real-time images of insulator inspections captured by drones are used as input data and fed into the trained Improved YOLOv11n model. Through forward inference, the model effectively suppresses interference from complex backgrounds (such as sky, vegetation, and hardware reflections), outputting high-precision predictions of insulator microcracks and damage defects, along with confidence scores and bounding box localization, thus achieving automated fault early warning.

[0044] To further intuitively verify the effectiveness of the present invention, the original YOLOv11n model and the improved YOLOv11n model of the present invention were used to analyze Figures a, b, and c respectively. Figure 5 The first column in the image is used for detection, and the resulting target detection heatmap is shown below. Figure 5 As shown, from Figure 5 As can be seen, in the original images, Figures a, b, and c all contain insulator strings, and the background is quite complex (including vegetation, strong light, etc.).

[0045] Figure 5 The second column of the graph shows the defect detection heatmap of the original YOLOv11n model on the three original graphs. As can be seen from the graph, the original YOLOv11n model has problems with repeated detection and easy attention divergence.

[0046] Figure 5 The third column shows the defect detection heatmaps of the three original images constructed by the Improved YOLOv11n model of this invention. As can be seen from the figure, the Improved YOLOv11n model can more accurately focus on the small defect areas of the insulator and significantly reduce false detections affected by the background. This proves that the present invention has better feature extraction capabilities and robustness in practical detection applications.

[0047] Furthermore, there is a non-obvious synergistic effect among the various improved modules of this invention. Ablation experiments show that while introducing multi-scale dilated convolution alone in YOLOv11n increases recall, the high dilation rate introduces excessive grid noise, leading to a 1.2% decrease in precision. Similarly, introducing Enhanced CBAM and Coord Attention alone improves the model's mAP by less than 0.5%. However, only when this invention cascades and fuses multi-scale dilated convolution, Enhanced CBAM, and Coord Attention in a specific order does the model achieve a 3.2% leap in overall precision (mAP@0.5:0.95) (compared to the original YOLOv11n). This fully demonstrates that the noise side effects inevitably introduced by dilated convolution when expanding the receptive field are perfectly eliminated by the downstream Enhanced CBAM; and the directional information lost by CBAM global pooling is perfectly compensated by the final Coord Attention. The three elements are not simply superimposed with each other, but form a non-linear, strongly correlated structure of "mutual generation and mutual restraint, and complementary advantages". This unconventional combination method has a good effect.

[0048] The Improved YOLOv11n model of this invention, along with existing YOLOv11n (baseline), YOLOv10n, YOLOv9t, and YOLOv8n models, were simultaneously used for insulator defect detection. The results are shown in Table 1. Table 1 As shown in Table 1, the proposed Improved YOLOv11n model achieves an mAP@0.5 of 0.970 for overall detection accuracy (mAP). In comparison, the original baseline model YOLOv11n has an mAP@0.5 of 0.952, while other current lightweight mainstream models such as YOLOv10n and YOLOv9t have mAP@0.5 of 0.939 and 0.947, respectively. The proposed method improves accuracy by 1.8 percentage points compared to the baseline model.

[0049] In terms of multi-scale localization and generalization ability, based on the comprehensive evaluation index mAP@0.5:0.95, the model of this invention achieved an accuracy of 0.695. This is an improvement of 3.2 percentage points compared to the original YOLOv11n (0.663), an improvement of 4.2 percentage points compared to YOLOv10n (0.653), and superior to YOLOv8n (0.674). The data shows that the MSDA-C2f module improves the localization accuracy under high IoU thresholds (the mAP of the method of this invention reaches 0.773), effectively enhancing the model's generalization adaptability to defects of different scales.

[0050] The original YOLOv11n model had a recall of 0.947 and a precision of 0.965, exhibiting a tendency for false positives when dealing with complex backgrounds. The model in this invention, while maintaining high recall (0.936), achieves a higher precision of 0.979 by effectively suppressing background interference. This demonstrates that the present invention possesses better discrimination ability while preserving the characteristics of extremely small-scale insulator defects.

[0051] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for detecting insulator defects based on an improved YOLOv11n, characterized in that: The steps include the following: S1. Data Acquisition and Preprocessing: Collect visible light images from UAV inspections, manually annotate insulator defects in the images to obtain image datasets, preprocess the image data, and construct training and test sets according to preset ratios. S2. Construct an improved YOLOv11n network model: In the YOLOv11n backbone network, replace the original C3k2 structure with the MSDA-C2f feature extraction module. The MSDA-C2f feature extraction module includes multi-scale dilated convolution, enhanced CBAM mechanism and Coord Attention mechanism; and output coordinate attention features through the Coord Attention mechanism. S3. Model Training: The Improved YOLOv11n model is trained and evaluated using the training and test sets obtained in S1 to obtain a trained model. S4. Output insulator defect prediction results and bounding boxes: The insulator inspection images collected in real time by the UAV are used as input data and fed into the trained Improved YOLOv11n model. The model outputs the predicted category, confidence level and bounding box location of the insulator defects, realizing automated fault early warning.

2. The insulator defect detection method based on the improved YOLOv11n according to claim 1, characterized in that: In S1, the image dataset includes the coordinates of the defect bounding box and category labels, and the categories include microcracks and damage.

3. The insulator defect detection method based on the improved YOLOv11n according to claim 1, characterized in that: In S1, preprocessing includes data cleaning, enhancement operations, and normalization. Data cleaning uses a contrast-limited adaptive histogram equalization algorithm to perform local illumination cleaning on the original image, increasing the high-frequency contrast between the insulator skirt edge and microcracks. Enhancement operations address the imbalance in the proportion of extremely small-scale crack samples in the dataset by setting up directional cropping and Mosaic stitching enhancement based on the physical contour of the insulator.

4. The insulator defect detection method based on the improved YOLOv11n according to claim 1, characterized in that: In S2, the MSDA-C2f feature extraction module inputs the feature map as follows: Channel dimension mapping is achieved through 1×1 convolution, unifying it to the target number of channels. And retain this feature map as a backup feature for the residual connection. .

5. The insulator defect detection method based on the improved YOLOv11n according to claim 4, characterized in that: In S2, the multi-scale dilated convolution is a four-branch parallel process, and the dilation rate of the parallel convolution is... The asymmetric exponential gradient is set to [1,2,4,8]. Adaptive fusion of four branches constructs a scale-complete basic feature subspace for subsequent attention modulation. The feature extraction formula for road branches is: In the formula Indicates the first The original feature map output by the path branch; This is a dilated convolution operation; The kernel size; No. The expansion rate of road branches; The backup features for residual connections are obtained through 1×1 convolution: =Conv 1×1 (X); Introducing learnable fusion weights The four features are weighted, concatenated, and compressed. The initial fusion features are output after fusion. : In the formula, For the first The feature map after weighting by the road; The Sigmoid activation function compresses the weight values ​​to the [0,1] interval. For the first The learnable adaptive weight scalars of the path are obtained through network training; This is the tensor after concatenating the four features; This is a splicing operation along the channel dimension; Batch Size; The target number of channels after unification. This refers to the number of channels after splicing, which is 4 channels × each channel. aisle; The height of the feature map; The width of the feature map; This is the fused feature map; Conv 1×1 It is a 1×1 convolution used for channel dimensionality reduction; The number of channels in the formula is from descend ; Indicates the shape of the dimension. The real tensor space.

6. The insulator defect detection method based on the improved YOLOv11n according to claim 5, characterized in that: In S2, the enhanced CBAM mechanism suppresses complex backgrounds and introduces a learnable residual scaling parameter initialized to 0. The formula is: In the formula, The feature map output by the Enhanced CBAM module. The learnable residual scaling parameter is initialized to 0; The fused feature map; Channel attention; Spatial attention; This represents the number of channels in the feature map.

7. The insulator defect detection method based on the improved YOLOv11n according to claim 6, characterized in that: In S2, the Coord Attention mechanism specifically works by incorporating input features... One-dimensional adaptive average pooling is performed along the horizontal and vertical directions: In the formula, Features obtained after pooling along the vertical direction; The features are obtained after pooling along the vertical horizontal direction; For adaptive two-dimensional average pooling; This indicates the output dimensions: the height remains the same, but the width is compressed to 1. For output dimensions: height is compressed to 1, width remains unchanged; Perform dimensionality reduction, activation, and dimensionality increase transformations to generate a directional attention map: In the formula, This is a vertical attention weight map; This is a horizontal attention weighting map; To reduce the number of channels from C to r×C 1×1 convolution, where r is the compression ratio; To increase the number of channels from r×C to C using a 1×1 convolution; To modify the activation function of the linear unit; For batch normalization; Final output coordinate attention features: In the formula, This is the final feature map output by the coordinate attention module.

8. The insulator defect detection method based on the improved YOLOv11n according to claim 7, characterized in that: In S3, before model training, the coordinate attention features are added to the initial backup features via residual connections: In the formula, Y represents the result of the residual connection and is the final output of the MSDA-C2f module.

9. The insulator defect detection method based on the improved YOLOv11n according to claim 1, characterized in that: In S3, the model training process includes: iteratively training the Improved YOLOv11n model using the training set constructed in S1; during the training process, calculating the loss value between the prediction result and the true label, optimizing the network parameters through the backpropagation algorithm until the loss function converges to a stable state, saving the optimal model weights, and after training is completed, testing and evaluating the model based on the optimal model weights using the test set.

10. The insulator defect detection method based on the improved YOLOv11n according to claim 9, characterized in that: In S3, during the initial stage of model training The value is 0, primarily using identity mapping to avoid subtle gradient vanishing. As training progresses, The loss function is adaptively increased gradually until it converges to a stable state and then stops increasing. The optimal value has been achieved.