Insulator defect detection method based on improved YOLOv11n
By improving the backbone network and feature fusion network of the YOLOv11n model, the problems of small defect miss detection and error classification in insulator defect detection are solved, and the detection effect of high precision and low computational complexity is achieved.
Patent Information
- Application Number
- CN202510588954.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-05-08
AI Technical Summary
Existing convolutional neural networks have problems of small defect miss detection and error classification in insulator defect detection, and the model lacks generalization performance under complex lighting conditions and occlusions, making it difficult to meet the real-time processing requirements.
Using the improved YOLOv11n model, the backbone network is built by introducing the SCConv module and the SPPCSPC module, and combining the SBA module and the improved Strip Pool module, the detection ability of insulator defects is enhanced, background interference is suppressed, and the model adaptability to the target shape and distribution is improved.
It improves the accuracy and robustness of insulator defect detection, reduces missed detection and missed detection, and meets the calculation complexity requirements of real-time detection of transmission lines.
Smart Images

Figure CN120563418A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to an insulator defect detection method based on improved YOLOv11n. Background Art
[0002] With the continuous expansion of power systems and the deepening development of smart grids, the safe and stable operation of power equipment has become a core element in ensuring the reliability of energy supply. Insulators, key components that provide mechanical support and electrical isolation in transmission lines, have a direct impact on the insulation strength and lightning protection capabilities of the power grid. Insulators exposed to complex natural environments for long periods of time are susceptible to factors such as contamination accumulation, material aging, and mechanical stress, leading to surface cracks, breakage, and flashover defects. In severe cases, these defects can cause insulation failure, line tripping, and even widespread power outages, threatening the safety and economic operation of the power system.
[0003] Traditional insulator defect detection relies primarily on manual inspections, infrared imaging, or drone aerial photography combined with visual interpretation. These methods suffer from low efficiency, high cost, strong subjectivity, and poor adaptability to high-altitude, high-risk environments. In recent years, the integration of computer vision and deep learning technologies has provided a new direction for automated insulator inspection. Defect recognition methods based on convolutional neural networks, through their autonomous feature learning capabilities, achieve higher detection robustness compared to traditional image processing algorithms in the presence of complex background interference. However, existing methods still face significant challenges in engineering applications: First, insulator defect scales vary widely, with fine cracks and localized damage susceptible to background noise, resulting in increased missed detection rates. Second, transmission line scenes experience variable lighting conditions and complex obstructions such as bird nests and vegetation, resulting in insufficient generalization performance for existing models and frequent false detections. Third, the contradiction between the need for lightweight detection and the computational complexity of the models is prominent, making it difficult to meet the real-time processing requirements of edge devices on transmission towers.
[0004] Although mainstream target detection frameworks such as the YOLO series and RetinaNet have been attempted to be applied to insulator defect recognition, their preset anchor frame mechanism and fixed receptive field design make it difficult to effectively capture defect features with variable morphologies, especially when detecting cracks with abnormal aspect ratios or contaminated areas with blurred edges, where the accuracy drops significantly. In addition, existing methods are mostly trained on general datasets and do not fully consider power scenario-specific issues such as the reflective properties of the insulator surface material and the imbalance of defect samples, resulting in performance degradation of the model in actual deployment. Therefore, developing an insulator defect detection method that combines high precision, strong robustness, and low computational overhead has important engineering value and social significance for realizing intelligent perception of transmission line status and preventing chain reactions caused by insulation faults.
[0005] However, the application of convolutional neural networks in insulator defect detection has long faced the problem of missing small defects and misclassifying defect types, resulting in low accuracy. Therefore, it is necessary to propose an effective insulator defect detection method to address these problems. Summary of the Invention
[0006] In response to the problem that convolutional neural networks are used in the process of insulator defect detection, small defects are missed and defect types are misclassified, resulting in low accuracy. This paper proposes an insulator defect detection method based on improved YOLOv11n. By suppressing the influence of background and other irrelevant information, the model's adaptability to target shape and distribution is improved, solving the problem of previous technologies missing small defects and misclassifying defect types, resulting in low accuracy.
[0007] The technical solution provided by the present invention comprises the following steps:
[0008] Step 1: Obtain an insulator defect image dataset, divide the dataset into a training set, a validation set, and a test set, and perform preprocessing;
[0009] Specifically, in step 1, the insulator defect images in the dataset are collected by aerial photography using a camera deployed on a drone at high altitude; and labeling information is added to the insulator defects using the LableImg labeling tool.
[0010] Step 2: Construct an insulator defect detection model based on the improved YOLOv11n, wherein the improved detection model includes an improved backbone network, an improved feature fusion network, and a head network;
[0011] Furthermore, the step 2 specifically includes steps 2.1 to 2.3:
[0012] Step 2.1: In the improved backbone network, replace the C3k2 module with the SCConv module, and replace the original SPPF module in the YOLO11n model backbone network with the SPPCSPC module to form a new backbone structure;
[0013] Furthermore, the SCConv module is composed of an SRU module and a CRU module connected in this way. The input feature map x is processed by the SRU to separate those feature maps with rich information from those corresponding to less spatial content information, and then the CRU module performs feature extraction;
[0014] Furthermore, the SRU module performs group normalization on the feature map x through the Group Normalization module. The specific operation of the Group Normalization module can be expressed as:
[0015]
[0016] where μ and σ are the mean and standard deviation of X, ε is a small positive constant added for division stability, and γ and β are trainable affine transformations.
[0017] The processed image is re-weighted, and the specific operation can be expressed as:
[0018]
[0019] Among them, γ i Indicates the spatial information richness of the i-th image. It is aggregated with the unweighted feature map through the Multiplication module, mapped to the range (0,1) through the sigmoid function, and gated by the threshold through the Threshold module. The weight above the threshold is set to 1 to obtain the information weight W1, and the weight below the threshold is set to 0 to obtain the non-information weight W2. The input feature x is multiplied by W1 and W2 respectively to obtain two weighted features: information-rich and information-rich. and less information Will and Split into and The information-rich features are converted into Features with less information The sum is x w1 and x w2 , the feature x reconstructed by the Concatenation module w1 and x w2 Connect them to get the spatially refined feature map x w .
[0020] Furthermore, the CRU module will w The channel is divided into two parts, namely, αC channel and (1-α)C channel, which pass through 1×1 convolution module to form X up , X low Two parts; X up The GWC module and the PWC module are used for convolution operation respectively, and then the Element-Wise Summation module is used to aggregate to obtain Y1, X low The PWC module is used for convolution, and the convolution is combined with the original X low Aggregate Y2 through the Element-Wise multiplication module and apply global average pooling. The specific operation can be expressed as:
[0021]
[0022] Get S1, S2, use the global upper and lower channels to stack S1 and S2 together, and use channel soft attention to generate feature importance vectors β1, β2. The specific operation can be expressed as:
[0023]
[0024] Through the Element-Wise Summation module, under the guidance of the feature importance vectors β1 and β2, the channel-refined feature Y is obtained by merging the upper feature Y1 and the lower feature Y2 in a channel manner. The specific operation can be expressed as:
[0025] Y=β1Y1+β2Y2 (5)
[0026] Furthermore, the SPPCSPC module inputs the feature map x into two branches respectively, wherein the feature map x of one branch is processed in sequence by a 1×1 convolution module, a 3×3 convolution module, and a 1×1 convolution module to obtain a feature map x′, and the feature map x′ is input into the three-branch structure with the maximum pooling module for pooling to obtain a feature map x″, and the feature map x″ and the feature map x′ are spliced through the Concat module to obtain a feature map x″′, and the spliced feature map x″′ is processed in sequence by a 1×1 convolution module and a 3×3 convolution module to obtain x n ; The other branch processes the feature map x through a 1×1 convolution module to obtain x m ; The obtained feature map x n and feature map x m Use the Concat module to concatenate and get x mn , after being processed by a 1×1 convolution module, the output;
[0027] Step 2.2: The improved feature fusion network, based on the YOLOv11n neck network, uses SBA module 1 and SBA module 2 to replace the Upsample module, and adds the newly designed LXMstrip Pool module 1 and LXMStrip Pool module 2 to improve the model's detection ability for irregular targets, forming a new feature fusion network;
[0028] Furthermore, the SBA module is used to fuse the boundary information of low-level features and the semantic information of high-level features to obtain finer-grained object contours and recalibrate the object's position. The fusion method in the SBA module uses the recalibrated attention unit (RAU) module, which adaptively extracts two inputs before fusion and transmits shallow and deep information to two RAU modules in different ways. The outputs of the two RUA modules are connected and input into a 1×1 Conv module. The specific operation of the RUA module is as follows:
[0029] T′1=W θ (T1) (6)
[0030]
[0031] RAU(T1,T2)=T′1⊙T1+T′2⊙T2⊙(θ(T′1))+T1 (8)
[0032] Among them, T1 and T2 are input features, and the two linear mappings and Sigmoid function W θ 、 Applied to the input features, it is used to reduce the channel dimension to 32 and obtain feature maps T1′ and T2′; ⊙ is point-by-point multiplication; It is the reverse operation achieved by subtracting the feature T1′, optimizing the inaccurate and rough estimate into an accurate and complete prediction map. A convolution operation with a kernel size of 1×1 is used as the linear mapping process. The specific operation of SBA is as follows:
[0033]
[0034] Among them, C 3×3 (·) is a convolution with kernel size 3×3 with batch normalization and ReLU activation layer, Contains the deep features of the image, Contains rich shallow features of the image. Concat(·) is a splicing operation along the channel dimension. It is the output of the SBA module;
[0035] Furthermore, the LXMstrip Pool module has one input, the input feature map x, which passes through Conv module 1, Conv module 5, and Conv module 10 respectively; wherein, Conv module 1 is a convolution block with a convolution kernel of 1×1, which plays the role of compressing the number of channels and reducing the amount of computation. The feature map output by Conv module 1 is recorded as x′ as the input of Pool module 1, Pool module 2, and DeformableConv module;
[0036] Pool module 1 performs adaptive average pooling operation on feature map x′. The specific operation of adaptive average pooling can be expressed as:
[0037]
[0038] in, X u,v Represents the value of the input feature map at the (u, v) position; (i, j) is the output position; H in and Win is the height and width of the input image, W out and H out The height and width of the output image, Output(i,j) is the output feature map;
[0039] The output of Pool module 1 is used as the input of Conv module 2. Conv module 2 performs convolution operation on the input feature map, and then undergoes upsampling operation through Upsample module 1;
[0040] Pool module 2 performs adaptive average pooling on the feature map x′. The output of Pool module 2 is used as the input of Conv module 3. Conv module 3 performs convolution operation on the input feature map, and then undergoes upsampling operation through Upsample module 2.
[0041] The DeformableConv module 1 extracts dynamic features of the feature map x′ through deformable convolution:
[0042] x″=DeformableConv(Conv 1×1 (x′)) (11) Where DeformableConv represents deformable convolution, and the specific operation of deformable convolution is expressed as:
[0043]
[0044] in, is the sampling grid of the convolution kernel, p n is a predefined fixed offset, w(p n ) is the convolution kernel weight, x(p0+p n ) is the input feature map at position p0+p n The value of Δp n is the offset learned from the input feature map;
[0045] The outputs of Upsample module 1, Upsample module 2 and DeformableConv module 1 are subjected to multi-scale feature fusion and smoothed by the ARelu activation function. The specific operation of ARelu is expressed as follows:
[0046]
[0047] Among them, α and β are learnable parameters. Clamp(α) limits α to [0.01, 0.99]. σ(β) is the Sigmoid function, which achieves adaptive activation by amplifying and suppressing positive and negative values respectively.
[0048] The result after ARelu processing is input into Conv module 4;
[0049] Furthermore, the input feature map x passes through Conv module 5. Conv module 5 is a convolution block with a convolution kernel of 1×1, which plays the role of compressing the number of channels and reducing the amount of calculation. The output of Conv module 5 is recorded as x′ and input into Adaptive_Pool module 1, Adaptive_Pool module 2 and DeformableConv module 2;
[0050] Adaptive_Pool module 1 performs a horizontal strip pooling operation on the feature map x′ and reduces its height spatial dimension to 1. The horizontal strip pooling operation can be expressed as:
[0051]
[0052] Among them, y h ∈R H , x∈R H×w , H is the height of the feature map, W is the width of the feature map, (i, j) corresponds to the position of the feature map;
[0053] The output of Adaptive_Pool module 1 is used as the input of Conv module 6. Conv module 6 performs convolution operation on the input feature map, and then undergoes upsampling operation through Upsample module 3;
[0054] Adaptive_Pool module 2 performs vertical strip pooling on the feature map x′ and reduces its width spatial dimension to 1. The vertical strip pooling operation can be expressed as:
[0055]
[0056] Among them, y v ∈R w , x∈R H×w , H is the height of the feature map, W is the width of the feature map, (i, j) corresponds to the position of the feature map;
[0057] The output of Adaptive_Pool module 2 is used as the input of Conv module 7. Conv module 7 performs convolution operation on the input feature map, and then undergoes upsampling operation through Upsample module 4;
[0058] DeformableConv module 2 extracts dynamic features of feature maps through deformable convolution;
[0059] The outputs of Upsample module 3, Upsample module 4 and DeformableConv module 2 are subjected to multi-scale feature fusion and smoothed by ARelu activation function; the result after ARelu processing is used as the input of Conv module 8;
[0060] Furthermore, the outputs of Conv module 8 and Conv module 4 are concatenated using Concat, and the concatenated result is input to Conv module 9. After the convolution operation of Conv module 9, the convolution result is aggregated with the result of Conv module 10, and then smoothed by ARelu activation function and output;
[0061] Step 2.3: In the head network, the features fused in step 2.2 are input into the head network of the YOLOv11n model to predict and screen the insulator defect detection results, thereby obtaining the final insulator defect detection prediction results and realizing insulator defect detection;
[0062] The detection head 1 receives the feature map output by the C3k2 module 2; the detection head 2 receives the feature map output by the LXMstrip Pool module 2; and the detection head 3 receives the feature map output by the LXMstrip Pool module 1.
[0063] Step 3: Use the training set and the validation set to train the insulator defect detection model based on the improved YOLOv11n, and save the trained optimal model;
[0064] Specifically, in step 3, training the insulator defect detection model based on the improved YOLOv11n requires setting the training parameters of the improved YOLOv11n model, including the number of iterations, batch size, optimizer, learning rate, momentum, weight decay, and number of threads; inputting the labeled training set and validation set into the improved detection model, calculating the gradient of the loss function through back propagation and updating the parameters using the optimizer; continuously iterating until the loss function of the training set and validation set and the evaluation indicators accuracy P, recall rate R, and mAP all tend to be stable and no longer improve, and finally saving the optimal model parameters.
[0065] Furthermore, in step 3, the insulator defect detection model testing and evaluation method based on the improved YOLOv11n is to input the test set into the optimal model described in step 3; calculate the model performance indicators: precision P, recall R, mAP, and the specific calculation formula is as follows:
[0066]
[0067] Among them, P is the precision, R is the recall rate, mAP is the average precision of all categories, AP is the average precision, m is the number of categories, TP is the number of positive samples correctly identified as positive samples, FP is the number of negative samples incorrectly identified as positive samples, and FN is the number of positive samples incorrectly identified as negative samples. When the performance indicators meet the accuracy requirements, the final insulator defect detection model based on the improved YOLOv11n is obtained.
[0068] Step 4: Use the test set to test the accuracy of the optimal model to obtain an insulator defect detection model that meets the accuracy requirements.
[0069] Compared with the prior art, the present invention has the following beneficial effects:
[0070] The present invention discloses an insulator defect detection method based on an improved YOLOv11. The method introduces the SCConv module and the SPPCSPC module to construct a new backbone network. The SCConv module replaces the original C3k2 module to reduce redundant features and lower computational complexity. In the final stage of feature extraction, the SPPCSPC module replaces the original SPPF model to enhance the model's ability to extract local defect features, which is beneficial for extracting small target defect features. A new feature fusion network is constructed by introducing the SBA module and the improved Strip Pool module. The SBA module focuses on the boundary area of the insulator defect, suppressing the influence of background and other irrelevant information. The improved Strip Pool module improves the model's adaptability to target shape and distribution, thereby reducing missed and false detections of insulator defects and improving detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 This is a structural diagram of the insulator defect detection model based on the improved YOLOv11n of the present invention;
[0072] Figure 2 Schematic diagram of the SCConv module structure;
[0073] Figure 3 It is a schematic diagram of the SPPCSPC module structure;
[0074] Figure 4 This is a schematic diagram of the SBA module structure;
[0075] Figure 5 This is a schematic diagram of the LXMStrip Pool module structure; DETAILED DESCRIPTION
[0076] In order to make the technical solutions, structural features, achieved objectives and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments and accompanying drawings. It should be noted that the specific embodiments described herein are only used to more clearly explain the present invention and are not intended to limit the present invention.
[0077] The present invention discloses an insulator defect detection method based on improved YOLOv11n, and its implementation process is as follows:
[0078] Step 1: Obtain an insulator defect image dataset, divide the dataset into a training set, a validation set, and a test set, and perform preprocessing;
[0079] In this embodiment, in order to better evaluate the detection effect of the insulator defect detection method based on the improved YOLO11n disclosed in the present invention, the public dataset IDD (Insulator-Defect Detection) insulator defect dataset was used;
[0080] In this example, the public dataset IDD has annotated information. The IDD dataset contains 5,000 accurately labeled images, of which 3,522 are used for training, 1,105 are used for validation, and 373 images are used as a test set.
[0081] Step 2: Construct an insulator defect detection model based on the improved YOLO11n. The model includes an improved backbone network, an improved feature fusion network, and a head network. The improved YOLO11n model structure is as follows: Figure 1 As shown, the construction of the improved detection model further includes steps 3.1 to 3.3:
[0082] Step 2.1: In the backbone network, replace the C3k2 module with the SCConv module, and replace the original SPPF module in the YOLO11n model backbone network with the SPPCSPC module to form a new backbone structure;
[0083] Furthermore, the SCConv module is composed of an SRU module and a CRU module connected in this way. The input feature map x is processed by the SRU to separate those feature maps with rich information from those with less information corresponding to spatial content. The CRU module then performs feature extraction. The SCConv module structure is as follows: Figure 2 As shown;
[0084] Furthermore, the SRU module performs group normalization on the feature map x through the Group Normalization module. The specific operation of the Group Normalization module can be expressed as:
[0085]
[0086] Where μ and σ are the mean and standard deviation of X, ε is a small positive constant added for division stability, and γ and β are trainable affine transformations;
[0087] The processed image is re-weighted, and the specific operation can be expressed as:
[0088]
[0089] Among them, γ i Indicates the spatial information richness of the i-th image. It is aggregated with the unweighted feature map through the Multiplication module, mapped to the range (0,1) through the sigmoid function, and gated by the threshold through the Threshold module. We set the weight above the threshold to 1 to obtain the information weight W1, and set the weight below the threshold to 0 to obtain the non-information weight W2. Multiply the input feature x by W1 and W2 respectively to obtain two weighted features: information-rich and information-rich. and less information Will and Split into and The information-rich features are converted into Features with less information The sum is x w1 and x w2 , the feature x reconstructed by the Concatenation module w1 and x w2 Connect them to get the spatially refined feature map x w ;
[0090] Furthermore, the CRU module will w The channel is divided into two parts, namely, αC channel and (1-α)C channel, which pass through 1×1 convolution module to form X up , X low Two parts; X up The GWC module and the PWC module are used for convolution operation respectively, and then the Element-Wise Summation module is used to aggregate to obtain Y1, X low The PWC module is used for convolution, and the convolution is combined with the original X low Aggregate Y2 through the Element-Wise multiplication module and apply global average pooling. The specific operation can be expressed as:
[0091]
[0092] Get S1, S2, use the global upper and lower channels to stack S1 and S2 together, and use channel soft attention to generate feature importance vectors β1, β2. The specific operation can be expressed as:
[0093]
[0094] Through the Element-Wise Summation module, under the guidance of the feature importance vectors β1 and β2, the channel-refined feature Y is obtained by merging the upper feature Y1 and the lower feature Y2 in a channel manner. The specific operation can be expressed as:
[0095] Y=β1Y1+β2Y2 (5)
[0096] Furthermore, the SPPCSPC module inputs the feature map x into two branches respectively, wherein the feature map x of one branch is processed by a 1×1 convolution module, a 3×3 convolution module, and a 1×1 convolution module in sequence to obtain a feature map x′, and the feature map x′ is input into the three-branch structure with the maximum pooling module for pooling to obtain a feature map x″, and the feature map x″ and the feature map x′ are spliced together by the Concat module to obtain a feature map x″′, and the spliced feature map x″′ is processed by a 1×1 convolution module and a 3×3 convolution module in sequence to obtain x n ; The other branch processes the feature map x through a 1×1 convolution module to obtain x m ; The obtained feature map x n and feature map x m Use the Concat module to concatenate and get x mn , after being processed by a 1×1 convolution module, the output is the SPPCSPC module structure. Figure 3 As shown;
[0097] Step 2.2: In the feature fusion network, based on the YOLOv11n neck network, the Upsample module is replaced by SBA module 1 and SBA module 2. The SBA module structure is as follows: Figure 4 As shown; the newly designed LXMstrip Pool module 1 and LXMStrip Pool module 2 are added, and the LXMStrip Pool module structure is as follows Figure 5 As shown in the figure, the model's ability to detect irregular targets is improved, forming a new feature fusion network;
[0098] Furthermore, the SBA module is used to fuse the boundary information of low-level features and the semantic information of high-level features to obtain finer-grained object contours and recalibrate the object's position. The fusion method in the SBA module uses the recalibrated attention unit (RAU) module, which adaptively extracts two inputs before fusion and transmits shallow and deep information to two RAU modules in different ways. The outputs of the two RUA modules are connected and input into a 1×1 Conv module. The specific operation of the RUA module is as follows:
[0099] T′1=W θ (T1) (6)
[0100]
[0101] Among them, T1 and T2 are input features, and the two linear mappings and Sigmoid function W θ 、 Applied to the input features, it is used to reduce the channel dimension to 32 and obtain feature maps T1′ and T2′; ⊙ is point-by-point multiplication; It is the reverse operation achieved by subtracting the feature T1′, optimizing the inaccurate and rough estimate into an accurate and complete prediction map. A convolution operation with a kernel size of 1×1 is used as the linear mapping process. The specific operation of SBA is as follows:
[0102]
[0103] Among them, C 3×3 (·) is a convolution with kernel size 3×3 with batch normalization and ReLU activation layer, Contains the deep features of the image, Contains rich shallow features of the image. Concat(·) is a splicing operation along the channel dimension. It is the output of the SBA module;
[0104] Furthermore, in the LXMstrip Pool module, the input feature x passes through Conv module 1. Conv module 1 is a convolution block with a convolution kernel of 1×1, which plays the role of compressing the number of channels and reducing the amount of calculation. The output of Conv module 1 is used as the input of Pool module 1, Pool module 2 and DeformableConv module 1, and is recorded as x′.
[0105] Pool module 1 performs adaptive average pooling operation on feature map x′. The specific operation of adaptive average pooling can be expressed as:
[0106]
[0107] in, X u,v Represents the value of the input feature map at the (u, v) position; (i, j) is the output position; H in and W in is the height and width of the input image, W out and H out The height and width of the output image, Output(i,j) is the output feature map;
[0108] The output of Pool module 1 is used as the input of Conv module 2 for convolution operation, and the output of Conv module 2 is used as the input of Upsample module 1 for upsampling operation;
[0109] Pool module 2 performs adaptive average pooling on the feature map x′. The output of Pool module 2 is used as the input of Conv module 3 for convolution operation. The output of Conv module 3 is used as the input of Upsample module 2 for upsampling operation.
[0110] Among them, the DeformableConv module 1 extracts the dynamic features of the feature map x″ through deformable convolution:
[0111] x″=DeformableConv(Cnov 1×1 (x′)) (11)
[0112] Among them, DeformableConv stands for deformable convolution, and the specific operation of deformable convolution is expressed as:
[0113]
[0114] in, is the sampling grid of the convolution kernel, p n is a predefined fixed offset, w(p n ) is the convolution kernel weight, x(p0+p n ) is the input feature map at position p0+p n The value of Δp n is the offset learned from the input feature map;
[0115] The outputs of Upsample module 1, Upsample module 2, and DeformableConv module 1 are subjected to multi-scale feature fusion and smoothed by the ARelu activation function. The formula of ARelu is:
[0116]
[0117] Among them, α and β are learnable parameters, Clamp(α) limits α to [0.01, 0.99], and σ(β) is a Sigmoid function that achieves adaptive excitation by amplifying and suppressing positive and negative values respectively.
[0118] The result after ARelu processing is used as the input of Conv module 4;
[0119] Furthermore, the LXMstrip Pool module has one input, the input feature map x; through the Conv module 5, the Conv module 5 is a convolution block with a convolution kernel of 1×1, which plays the role of compressing the number of channels and reducing the amount of calculation. The output of the Conv module 5 is recorded as x′ and input into the Adaptive_Pool module 1, the Adaptive_Pool module 2 and the DeformableConv module 2;
[0120] Adaptive_Pool module 1 performs a horizontal strip pooling operation on the feature map x′ and reduces its height spatial dimension to 1. The horizontal strip pooling operation can be expressed as:
[0121]
[0122] Among them, y h ∈R H , x∈R H×w , H is the height of the feature map, W is the width of the feature map, (i, j) corresponds to the position of the feature map;
[0123] The output of Adaptive_Pool module 1 is used as the input of Conv module 6, and then goes through Conv module 6 for convolution operation and Upsample module 3 for upsampling operation.
[0124] Adaptive_Pool module 2 performs vertical strip pooling on the feature map x′ and reduces its width spatial dimension to 1. The vertical strip pooling operation can be expressed as:
[0125]
[0126] Among them, y v ∈R w , x∈R H×W , H is the height of the feature map, W is the width of the feature map, (i, j) corresponds to the position of the feature map;
[0127] The output of Adaptive_Pool module 2 is used as the input of Conv module 7, and then goes through Conv module 7 for convolution operation and Upsample module 4 for upsampling operation.
[0128] DeformableConv module 2 extracts dynamic features of feature maps through deformable convolution;
[0129] The outputs of Upsample module 3, Upsample module 4 and DeformableConv module 2 are subjected to multi-scale feature fusion and smoothed by ARelu activation function; the result after ARelu processing is used as the input of Conv module 8;
[0130] Furthermore, the outputs of Conv module 8 and Conv module 4 are concatenated using Concat, and the concatenated result is input to Conv module 9. After the convolution operation of Conv module 9, the convolution result is aggregated with the original feature map and output after smoothing by ARelu activation function.
[0131] Step 2.3: In the head network, the features fused in step 2.2 are input into the head network of the YOLOv11n model to predict and screen the insulator defect detection results, thereby obtaining the final insulator defect detection prediction results and realizing insulator defect detection;
[0132] The detection head 1 receives the feature map output by the C3k2 module 2; the detection head 2 receives the feature map output by the LXMstrip Pool module 2; the detection head 3 receives the feature map output by the LXMstrip Pool module 1;
[0133] Step 3: Input the training set and validation set into the insulator defect detection model based on the improved YOLOv11n described in step 2 for training. In this embodiment, the experimental settings set the initial learning rate to 0.01, the SGD optimizer, the batch size to 32, and the total number of training rounds to 150; the improved model calculates the loss function gradient through the back propagation algorithm, and uses the chain rule to transfer the error layer by layer and generate the parameter gradient. The gradient size reflects the degree of influence of the parameter on the loss; the optimizer updates the parameters according to the gradient direction. When the gradient is large, the adjustment amplitude is large, and vice versa. The loss function value is continuously reduced during the iteration process, so that the improved model prediction approaches the true label; when the loss function and the evaluation indicators mAP, recall rate R, and precision rate P of the training set and validation set are stable and no longer improve, the training is stopped, and the optimal model parameters at this time are saved;
[0134] Step 4: Use the test set to test the optimal model described in step 3, evaluate the test set test results, and ensure that the accuracy requirements are met, that is, obtain the final insulator defect detection model based on the improved YOLOv11n, and input the test set into the optimal model described in step 3; calculate the model performance indicators: precision P, recall R, and mAP. The specific calculation formulas are as follows:
[0135]
[0136] Among them, P is the precision, R is the recall rate, mAP is the average precision of all categories, AP is the average precision, m is the number of categories, TP is the number of positive samples correctly identified as positive samples, FP is the number of negative samples incorrectly identified as positive samples, and FN is the number of positive samples incorrectly identified as negative samples. When the performance indicators meet the accuracy requirements, the final insulator defect detection model based on the improved YOLOv11n is obtained.
[0137] In this embodiment, in order to verify the effect of the detection model disclosed in the patent of this invention, this paper uses the YOLOv11n model, YOLOv10n model, YOLOv8n model, YOLOv7-tiny model, YOLOv11n model + SCConv + SPPCSPC + SBA and the detection model proposed in the patent of this invention to test on the IDD dataset. The evaluation results are shown in Table 1. Among them, the insulator defect detection model based on the improved YOLOv11n proposed in this paper is superior to other comparison models in terms of precision P, recall rate R, mAP@0.5 and mAP@0.5:0.95 evaluation indicators.
[0138] Table 1 Comparative experimental results
[0139]
[0140] The above description is only one embodiment of the present invention and does not limit the patent scope of the present invention. For those skilled in the art, the present invention may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. An insulator defect detection method based on improved YOLOv11n, characterized in that: The specific steps include: Step 1: Obtain an insulator defect image dataset, divide the dataset into a training set, a validation set, and a test set, and perform preprocessing; Step 2: Construct an insulator defect detection model based on the improved YOLOv11n. The improved detection model includes an improved backbone network, an improved feature fusion network and a head network. The construction of the improved detection model further includes steps 2.1 to 2.3: Step 2.1: The improved backbone network consists of Conv module 1, Conv module 2, SCConv module 1, Conv module 3, SCConv module 2, Conv module 4, SCConv module 3, Conv module 5, SCConv module 4, SPPFCSPC module, and C2PSA module connected in sequence to form a new backbone network structure; Using the training set and the validation set in the data set as inputs of the backbone network; The improved backbone network outputs feature information of three different scales through SCConv module 2, SCConv module 3 and C2PSA module respectively; Step 2.2: The improved feature fusion network, based on the YOLOv11n neck network, uses SBA module 1 and SBA module 2 to replace the original Upsample module, and adds the newly designed LXMstrip Pool module 1 and LXMstripPool module 2; The output of the C2PSA module serves as the input of the SBA module 1; The Concat module 1 receives the output from the SCConv module 3 and the SBA module 1 as input, and then passes through the C3k2 module 1 and the SBA module 2 in sequence; The Concat module 2 receives the output from the SCConv module 2 and the SBA module 2 as input, and then passes through the C3k2 module 2 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 and the Conv module 7 in sequence; The Concat module 4 receives the output from the Conv module 7 and the C2PSA module as input, and then passes through the C3k2 module 4 in sequence; The LXMStrip Pool module 1 and the LXMStrip Pool module 2 receive the outputs from the C3k2 module 4 and the Concat module 3 as inputs respectively; Step 2.3: Input the fused features in step 2.2 into the head network of the YOLOv11n model to predict and screen the insulator defect detection results, obtain the final insulator defect detection prediction results, and implement insulator defect detection; The head network of the YOLOv11n model 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 LXMStrip Pool module 2; detection head 3 receives the feature map output by LXMStrip Pool module 1; Step 3: Using the training set and the validation set to train the insulator defect detection model based on the improved YOLOv11n, and saving the trained optimal model; Step 4: Use the test set to perform accuracy test on the optimal model, and if the accuracy requirement is met, the final insulator defect detection model is obtained.
2. The insulator defect detection method based on improved YOLOv11n according to claim 1 is characterized in that: The preprocessing is to manually label the training set, the validation set and the test set.
3. The insulator defect detection method based on improved YOLOv11n according to claim 1 is characterized in that: In step 2.2, LXMstrip Pool module 1 and LXMstrip Pool module 2 have the same structure; the internal process of the LXMstrip Pool module further includes steps 2.2.1 to 2.2.3: Step 2.2.1: The LXMstrip Pool module has one input, the input feature map x, which passes through Conv module 1, Conv module 5, and Conv module 10 respectively. Among them, Conv module 1 is a convolution block with a convolution kernel of 1×1, which plays the role of compressing the number of channels and reducing the amount of computation. The feature map output by Conv module 1 is denoted as x′ and serves as the input of Pool module 1, Pool module 2, and DeformableConv module. Pool module 1 performs adaptive average pooling operation on feature map x′. The specific operation of adaptive average pooling can be expressed as: in, X u,v Represents the value of the input feature map at the (u, v) position; (i, j) is the output position; H in and W in is the height and width of the input image, W out and H out The height and width of the output image, Output(i,j) is the output feature map; The output of Pool module 1 is used as the input of Conv module 2. Conv module 2 performs convolution operation on the input feature map, and then undergoes upsampling operation through Upsample module 1; Pool module 2 performs adaptive average pooling on the feature map x′. The output of Pool module 2 is used as the input of Conv module 3. Conv module 3 performs convolution operation on the input feature map, and then undergoes upsampling operation through Upsample module 2. The DeformableConv module 1 extracts dynamic features of the feature map x′ through deformable convolution: x″=DeformableConv(Cnov 1×1 (x′)) (2) Where DeformableConv represents deformable convolution, and the specific operation of deformable convolution is expressed as: in, is the sampling grid of the convolution kernel, p n is a predefined fixed offset, w(p n ) is the convolution kernel weight, x(p0+p n ) is the input feature map at position p0+p n The value of Δp n is the offset learned from the input feature map; The outputs of Upsample module 1, Upsample module 2 and DeformableConv module 1 are subjected to multi-scale feature fusion and smoothed by the ARelu activation function. The specific operation of ARelu is expressed as follows: Among them, α and β are learnable parameters. Clamp(α) limits α to [0.01, 0.99]. σ(β) is the Sigmoid function, which achieves adaptive activation by amplifying and suppressing positive and negative values respectively. The result after ARelu processing is input into Conv module 4; Step 2.2.2: Input feature map x and pass it through Conv module 5. Conv module 5 is a convolution block with a convolution kernel of 1×1, which plays the role of compressing the number of channels and reducing the amount of computation. The output of Conv module 5 is recorded as x′ and input into Adaptive_Pool module 1, Adaptive_Pool module 2 and DeformableConv module 2; Adaptive_Pool module 1 performs a horizontal strip pooling operation on the feature map x′ and reduces its height spatial dimension to 1. The horizontal strip pooling operation can be expressed as: Among them, y h ∈R H , x∈R H×W , H is the height of the feature map, W is the width of the feature map, (i, j) corresponds to the position of the feature map; The output of Adaptive_Pool module 1 is used as the input of Conv module 6. Conv module 6 performs convolution operation on the input feature map, and then undergoes upsampling operation through Upsample module 3; Adaptive_Pool module 2 performs vertical strip pooling on the feature map x′ and reduces its width spatial dimension to 1. The vertical strip pooling operation can be expressed as: Among them, y v ∈R w , x∈R H×W , H is the height of the feature map, W is the width of the feature map, (i, j) corresponds to the position of the feature map; The output of Adaptive_Pool module 2 is used as the input of Conv module 7. Conv module 7 performs convolution operation on the input feature map, and then undergoes upsampling operation through Upsample module 4; DeformableConv module 2 extracts dynamic features of feature maps through deformable convolution; The outputs of Upsample module 3, Upsample module 4 and DeformableConv module 2 are subjected to multi-scale feature fusion and smoothed by ARelu activation function; the result after ARelu processing is used as the input of Conv module 8; Step 2.2.3: The outputs of Conv module 8 and Conv module 4 are concatenated using Concat. The concatenated result is input to Conv module 9. After the convolution operation of Conv module 9, the convolution result is aggregated with the result of Conv module 10 and output after smoothing by ARelu activation function.
4. The insulator defect detection method based on improved YOLOv11n according to claim 1 is characterized in that: The step 3 further includes setting the training parameters of the improved YOLOv11n model, including the number of iterations, batch size, optimizer, learning rate, momentum, weight decay, and number of threads, inputting the labeled training set and validation set into the improved detection model, calculating the gradient of the loss function by backpropagation and updating the parameters using the optimizer, and continuously iterating until the loss function of the training set and validation set and the evaluation indicators accuracy P, recall rate R, and mAP all tend to be stable and no longer improve, and finally saving the optimal model parameters.
5. The insulator defect detection method based on improved YOLOv11n according to claim 1 is characterized in that: Input the test set into the optimal model described in step 3; calculate the model performance indicators: precision P, recall R, mAP, the specific calculation formula is as follows: AP = ∫0 1 P(R)dR (10) Where P is the precision, R is the recall, mAP is the average precision of all categories, AP is the average precision, m is the number of categories, TP is the number of positive samples correctly identified as positive samples, FP is the number of negative samples incorrectly identified as positive samples, and FN is the number of positive samples incorrectly identified as negative samples. When the performance indicators meet the accuracy requirements, the final insulator defect detection model based on the improved YOLOv11n is obtained.
Citation Information
Patent Citations
SAR image road extraction method and system based on dynamic mixing pooling strategy
CN115393712A
Insulator defect detection method and system based on YOLO detector
CN117455923A
Lightweight insulator defect detection method based on improved YOLOv5 network
CN118967550A
Deep-learning-based target detection method for defects of image of inner side of commutator
WO2024208102A1
Cited By
Method and device for detecting small tin beads of metal heating film
CN121213557A
Steel surface defect detection method and system based on RDDW-YOLO
CN121236059A
Welding defect intelligent detection method and system based on deep learning
CN121258887A
Insulator defect detection method oriented to complex background
CN122048838A
Insulator defect detection method in complex background
CN122048838B