YOLOv11n-based modeling method for insulator defect detection model of unmanned aerial vehicle polling high-voltage transmission line
By improving the YOLOv11n model and combining Retinex image enhancement and various optimization techniques, the accuracy and robustness issues in insulator defect detection were resolved, achieving efficient and accurate UAV inspection results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-03-10
AI Technical Summary
Existing deep learning-based insulator defect detection methods suffer from insufficient detection accuracy and high rates of missed and false detections in real-world scenarios such as complex background interference, drastic changes in target size, and excessively small targets, making it difficult to meet the real-time and high-precision requirements of UAV inspection.
An improved YOLOv11n model is adopted, which combines the Retinex image enhancement algorithm, depthwise separable convolution DWConv, RFCAConv module, P2 detection layer and Inner-SIoU loss function to optimize the model structure and improve detection accuracy and robustness.
It achieves high-precision identification of insulator defects with low computational resource consumption, significantly improving detection performance and practical value, and adapting to efficient inspection tasks in complex field environments.
Smart Images

Figure CN121640320A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent inspection technology for power transmission lines, specifically to a modeling method for detecting insulator defects in high-voltage power transmission lines using a drone based on YOLOv11n. Background Technology
[0002] Insulators are critical components in power transmission lines, providing both support and insulation. Due to their large number and long-term exposure to the natural environment, they are susceptible to defects such as aging, falling off, breakage, contamination, and flashover due to harsh operating conditions, seriously affecting line safety. Among these, breakage and flashover are two of the most common, most dangerous, and difficult-to-detect microscopic defects. Their causes are mainly due to: the accumulation of contaminants (such as dust and salt) during long-term outdoor operation distorting the local electric field and inducing flashover; and physical impacts and inadequate manufacturing processes also easily lead to breakage. Once these defects occur, they directly threaten the stable operation of the power transmission system and may even cause power outages.
[0003] Manual inspection, as a traditional method of insulator testing, faces numerous challenges, including low efficiency, limited coverage, high safety risks, and susceptibility to subjective influence on results, making it difficult to meet the needs of modern power grid lean operation and maintenance. In recent years, the rise of deep learning has provided a new solution for intelligent power equipment inspection: by using drones to collect images and leveraging deep learning models to automatically identify defects, this method has achieved a qualitative leap in inspection efficiency, accuracy, and safety. Target detection algorithms have evolved into two technical routes: two-stage and single-stage. Two-stage models, represented by the R-CNN series, offer excellent detection accuracy, but their cumbersome process leads to slow inference speeds, failing to meet real-time requirements. To address real-time requirements, single-stage models such as YOLO and SSD have emerged. These models use an end-to-end architecture to simultaneously predict target category and location, meeting real-time requirements with extremely high detection efficiency while also maintaining accuracy.
[0004] Although existing research has proposed various deep learning-based insulator defect detection methods, these methods still face challenges such as insufficient detection accuracy, high false positive and false negative rates, and insufficient robustness and generalization ability in real-world scenarios involving complex background interference, drastic changes in target scale, and excessively small targets. Therefore, developing an insulator defect detection method that combines high accuracy, strong robustness, and low computational complexity, and applying it to UAV inspection systems, has significant engineering application value and social significance for realizing intelligent perception of transmission line conditions and preventing cascading accidents caused by insulation faults. Summary of the Invention
[0005] This invention provides a modeling method for detecting insulator defects in high-voltage transmission lines using YOLOv11n based on unmanned aerial vehicles (UAVs). This method achieves high-precision identification of insulator defects while maintaining low computational resource consumption by deeply optimizing the model structure and introducing innovative modules. This method can effectively adapt to efficient inspection tasks in various complex field environments, significantly improving detection performance and practical value at the edge device level.
[0006] The technical solution adopted in this invention is as follows: The modeling method for detecting defects in insulators of high-voltage transmission lines using UAVs based on YOLOv11n includes the following steps: Step 1: Collect images of insulator defects using a drone, and preprocess the images to form a dataset; Step 2: Construct an insulator defect detection model based on the improved YOLOv11n; Step 3: Train the insulator defect detection model based on the improved YOLOv11n constructed in Step 2 to obtain the optimal model; Step 4: Use the validation set to verify the accuracy of the optimal model constructed in Step 3, and obtain an insulator defect detection model that meets the accuracy requirements.
[0007] Step 1 includes the following steps: Step 1.1: Use the LabelImg annotation tool to add annotation information to the insulator images of the power line taken by the UAV at high altitude; the details are as follows: First, import the aerial images into the LabelImg tool and switch to YOLO format. Then, use the tool's rectangular selection function to accurately select the defective regions of the insulators in the image (such as normal, broken, flashover, and self-explosion). Simultaneously, add corresponding labels (such as "normal", "breakage", "discharge", and "self-explosion") to each defective region. After completing the annotation of a single image, an automatic .txt annotation file containing defect category indexes and normalized coordinates is generated. The purpose of this step is to build a structured insulator defect dataset, providing standardized sample input for the subsequent training of the automatic insulator defect detection algorithm of the defect detection model, ensuring the accuracy and generalization ability of the defect detection model.
[0008] Step 1.2: Process the labeled insulator defect image using the Retinex image enhancement algorithm; The Retinex image enhancement algorithm is based on the color constancy theory of the human visual system. Its fundamental principle states that the color perception of an object depends on its reflectivity to long-wavelength, medium-wavelength, and short-wavelength light, rather than the absolute intensity of the incident light. In contrast, traditional image enhancement methods often only target and enhance a single type of image feature. The Retinex algorithm, however, comprehensively achieves dynamic range compression, edge enhancement, and color constancy, thus achieving adaptive enhancement effects for various images. Its evolution has resulted in various implementations, including single-scale SSR, multi-scale MSR, and multi-scale MSRCR color restoration algorithms. While these methods differ in specific strategies, they all share the core idea of multi-scale processing, aiming to optimize image brightness and color fidelity.
[0009] The single-scale SSR algorithm estimates the illumination components from the original image using a specific Gaussian surround function, and then separates the reflection components, which represent the essential properties of the object. This process is completed in the logarithmic domain through difference operations. Finally, image enhancement is achieved by reconstructing the reflection components, effectively compressing the dynamic range and improving the overall visual effect. The single-scale SSR algorithm can effectively compress the image dynamic range, enhance details, and achieve uniform illumination, enabling the capture of small scales to enhance details. The calculation formula is as follows: (1); (2); (3); (4); In the above formula, Represents the original image; Indicates the reflected component; Indicates the light component; Indicates a center-wrap function; Indicates the convolution scale; Indicates the Gaussian surround scale; This represents the output image of the single-scale SSR algorithm. Indicates the convolution symbol; The multi-scale MSR algorithm evolved from the SSR algorithm and boasts extremely high fidelity and dynamic range compression capabilities, effectively improving image quality. The calculation formula is as follows: (5); In equation (5), This represents the output image of the multi-scale MSR algorithm; Representing different weights; These are Gaussian convolution functions of different scales; n is the number of Gaussian center wrapping functions. When n=1, the MSR algorithm is consistent with SSR. The multi-scale MSRCR algorithm for color restoration incorporates a color restoration factor. Adjusting local areas of the image to compensate for color distortion caused by contrast enhancement, the calculation formula is as follows: (6); In equation (6), This indicates that after processing by the color restoration multi-scale MSRCR algorithm, the [value] is [value]. i Output image of each channel; The recovery factor represents the color of the nth channel, which is used to adjust the color ratio of the 3 channels, thereby highlighting the information in the relatively dark areas and eliminating the defects of image color distortion. This represents the image after multi-scale MSR algorithm enhancement of the i-th channel without color restoration adjustment.
[0010] In the Retinex algorithm system, the single-scale SSR algorithm, as the basic implementation of this type of algorithm, only uses a Gaussian kernel function of a single scale to process the image. The single-scale SSR algorithm has the technical defects of limited image enhancement effect and easy loss of detail information. In order to optimize the detail preservation capability, the multi-scale MSR algorithm is further formed by fusing the SSR processing results of multiple scales. However, the multi-scale MSR algorithm is prone to causing image color distortion during the enhancement process. In order to solve the defects of the MSR algorithm, a color restoration factor is introduced on the basis of the MSR algorithm, which leads to the color restoration multi-scale MSRCR algorithm. The MSRCR algorithm can effectively eliminate the color distortion caused by the MSR algorithm and is the most widely used technical solution in the field of Retinex image enhancement. In scenes such as aerial images of insulators that are sensitive to color information, it is necessary to simultaneously consider detail enhancement and color fidelity. The MSRCR algorithm of Retinex image enhancement is the preferred choice.
[0011] In the scenario of enhancing images of power line insulators captured by drones, the Retinex algorithm has significant technical advantages in addressing issues such as blurred image details and dull colors under complex high-altitude lighting. Based on multi-scale processing logic, the Retinex algorithm can simultaneously enhance the local contrast of the insulator body and defect areas, solving the problem of defect information loss in backlit scenes and improving the identifiability of defect features. With the help of the MSRCR color restoration factor, it can maintain the inherent color of the insulator, avoid "color whitening", ensure the color distinction between the insulator and the background, and reduce the risk of misjudgment in subsequent annotation and recognition. At the same time, it can adapt to the noise characteristics of aerial images, suppressing noise and stabilizing the geometric features of insulators through multi-scale Gaussian kernel fusion, providing high-quality input samples for defect detection models. Moreover, the Retinex algorithm has good adaptability to aerial images of different time periods and weather conditions, and the enhancement results can be directly connected to existing annotation tools and detection models without additional format conversion, effectively improving the overall process efficiency of the power transmission line inspection system.
[0012] Step 1.3: Divide the preprocessed insulator defect image dataset into training set, test set and validation set in a ratio of 8:1:1.
[0013] In step 2, the YOLOv11n improvements specifically include: 2.1: In the improved backbone network, depthwise separable convolution (DWConv) is used to replace the original standard convolution operation. By decomposing the standard convolution into depthwise convolution and pointwise convolution, the aim is to reduce the total number of parameters and computational complexity of the model. Depthwise separable convolution (DWConv) is decomposed into two sequential steps. First, depthwise convolution is performed, using a kernel equal to the number of input channels. Spatial convolution is performed independently on each input channel to efficiently extract spatial features. Then, pointwise convolution is performed, fusing all output channels using a 1×1 kernel to learn cross-channel feature combinations. The output of DWConv is calculated as follows: (7); (8); In the above formula, This represents the output of the depthwise convolution. This represents the output of pointwise convolution. Represents the depthwise convolution kernel. Represents the pointwise convolution kernel; X Indicates the input quantity; This represents a depthwise convolution operation; This indicates a pointwise convolution operation.
[0014] 2.2: A novel neck network structure, RFADS, is proposed, and a P2 detection layer is introduced before the small target detection layer; The neck network architecture RFADS first replaces the native convolutions of YOLOv11 with RFCAConv convolutional modules; Subsequently, the C3k2 module in the output section of the detection head was replaced with the C3k2-DSConv module, so that the receptive field fits the target shape better, thereby significantly expanding the effective recognition range; 2.2.1: The RFCAConv convolutional module deeply integrates the receptive field attention (RFA) and the SE attention module. While retaining the ability of the receptive field attention (RFA) to finely model local features within the receptive field, it strengthens the selection of key channel features through the channel attention mechanism of the SE attention module, thereby achieving synergy between receptive field-level local optimization and channel-level global enhancement, while maintaining extremely low computational overhead. The SE attention module is a classic channel attention mechanism. Its core functionality involves learning the importance weights between channels through "squeeze" and "excitation" operations, thereby enhancing key channel features and suppressing redundant channels. "Squeeze" uses global average pooling to extract spatial information from each channel. The value is compressed into a scalar, capturing the global response of that channel. For the compressed scalar of the k-th channel... The calculation formula is: (9); In equation (9), Represents the k-th channel and spatial location of the input feature map. The feature values. After compression, a channel descriptor vector is obtained: (10); In equation (10), This represents the channel descriptor vector obtained after the input feature map has undergone a "squeezing" operation; These represent the 1st to the 1st elements in the input feature map, respectively. k The scalar value obtained after the "squeeze" operation on each channel; The "Excitation" step processes the channel descriptor S through a lightweight network ("dimensionality reduction-activation-dimensionality increase") to generate channel attention weights and model the dependencies between channels. Receptive field attention RFA not only focuses on the spatial features of the receptive field, but also provides effective attention weights for large-size convolutional kernels. The calculation formula is as follows: (11); In equation (11), Indicates the size is Grouped convolutions; The kernel size is represented by: `Norm` represents normalization; `X` represents the input feature map; `A` represents the attention map; and `F` represents the receptive field spatial features. This represents the normalized activation function; Represents a linear rectified function; This indicates that a global average pooling operation is performed on the input feature map X; This indicates that the size is Grouped convolution The output results are normalized. Indicates the size is Grouped convolutions; 2.2.2: Replace the C3k2 module in the output section of the detection head with the C3k2-DSConv module to make the receptive field fit the target shape better, thereby significantly expanding the effective recognition range.
[0015] The DSConv module consists of concatenated depthwise convolutions and pointwise convolutions, performing feature extraction step by step. The depthwise convolution applies an independent kernel to each channel of the input feature map, capturing only the spatial relationships within that channel (such as edges and textures), without involving information fusion between channels. The calculation formula for the c-th channel is as follows: (12); In equation (12), Indicates the output quantity; This represents one input channel corresponding to each convolutional kernel; X Indicates the input quantity; Indicates the height of the output feature map; Indicates the width of the output feature map; The channel indices of the input and output feature maps; The offset representing the height of the convolution kernel; The offset representing the width of the convolution kernel; Indicates the kernel size used in depthwise convolution; After depthwise convolution, the spatial location of the c-th channel is... The output feature value; This indicates the position within the depthwise convolution kernel corresponding to the c-th channel. The weight value at the location; This represents the spatial location of the c-th channel in the input feature map. The original feature value at the location; Pointwise convolution The output of convolution versus depthwise convolution Perform inter-channel fusion and adjust the number of output channels to the target dimension. , No. The formula for calculating each output channel is as follows: (13); In equation (13), This indicates that after pointwise convolution, the first... Each output channel, spatial location The final output feature value at the location; This indicates the corresponding input channel in the 1×1 convolution kernel used. c To output channel The weight value; This represents the output feature value of the depthwise convolution stage; This represents the number of input channels for pointwise convolution; This represents the target number of output channels for pointwise convolution; 2.3: In insulator defect detection, the loss function is crucial to the model training effect. This invention introduces the Inner-SIoU loss function to improve the model's detection accuracy and robustness; Compared to the traditional IoU loss function, the SIoU loss function has undergone a crucial extension. In addition to the Intersection over Union (IoU) calculation, it adds angular and shape constraints for the bounding box. This comprehensive consideration strengthens the supervision of the predicted box regression process, enabling it to better handle target rotation and deformation, ultimately exhibiting superior stability and robustness when dealing with complex targets. The expression is: (14); (15); In the formula, This represents the calculation result of the SIOU loss function; This represents the distance loss term, which measures the distance between the center points of the predicted bounding box and the ground truth bounding box, and is adjusted based on this distance. The shape loss term measures the shape difference between the predicted bounding box and the ground truth bounding box, particularly the aspect ratio; IoU is the standard intersection-over-union ratio, representing the overlap between the predicted and ground truth bounding boxes; 𝐵 represents the predicted bounding box. Represents the true bounding box; when calculating IoU, Represents the center coordinates of the true bounding box. Indicates the center coordinates of the prediction box. and These represent the width and height of the actual bounding box, respectively. and Let represent the width and height of the prediction box, respectively. The formula for calculating the auxiliary boundary is: (16); In equation (16), This represents the left boundary of the auxiliary bounding box of the real bounding box. This represents the right boundary of the auxiliary bounding box of the real bounding box. This represents the upper boundary of the auxiliary bounding box of the real bounding box. This represents the lower boundary of the auxiliary bounding box of the real bounding box. This represents the scaling ratio of the auxiliary box, used to adjust its size; the formula for calculating the predicted box is: (17); In equation (17), Indicates the left boundary of the prediction box. Indicates the right boundary of the prediction box. Indicates the upper boundary of the prediction box. This indicates the lower boundary of the prediction box. This indicates the scaling ratio of the auxiliary box, used to adjust its size; the formulas for calculating the intersection and union are: (18); (19); In the above formula, inter represents the area of the intersection between the auxiliary boxes; union represents the area of the union; therefore, the formula for the internal intersection-union ratio is: (20); In equation (21), Indicates the internal intersection-union ratio; The formula for calculating the Inner-SloU loss function is: (twenty one); In equation (21), Represents the Inner-SIoU loss function; It is the standard SIoU loss function; IoU It is the intersection-over-union ratio between the predicted bounding box and the ground truth bounding box; The internal crossover ratio is calculated using an auxiliary bounding box.
[0016] Because the P2 layer has higher spatial resolution, it can preserve the fine texture and edge features of small targets (such as insulator defects), making up for the loss of details caused by downsampling in traditional detection layers. At the same time, the newly added P2 detection layer further improves the hierarchical coverage of multi-scale detection, enhances the model's ability to perceive small targets, and can effectively improve the accuracy and recall of small target detection, especially suitable for detection scenarios such as insulators containing tiny defects. Therefore, the P2 detection layer is introduced before the small target detection layer. First, multi-scale features are extracted in the backbone network through modules such as DWConv and C3k2. When the features are processed to the P2 layer (i.e., the feature layer with the highest resolution in the backbone network), its output is introduced into the RFADS module. After feature refinement by C3k2-DSConv, it is directly connected to the corresponding Detect head. At the same time, information fusion is completed with the upper layer features through the Concat operation. Finally, the P2 layer participates in the target detection process of the neck network as a new detection branch. In step 3, the insulator defect detection model based on the improved YOLOv11n is trained using a training set and a test set. During the training phase of the improved YOLOv11n insulator defect detection model, the following hyperparameters need to be configured: The training iterations were set to 300, the batch size to 32, the optimizer to SGD, the initial learning rate to 0.01, the weight decay coefficient to 0.0005, and the optimizer momentum to 0.937. These parameters provided the basic configuration for the model training process. Subsequently, the labeled training and test sets are input into the model. First, the prediction results (defect box coordinates, class probability, etc.) are obtained through forward propagation. The loss value is calculated with the labeled training and validation set true labels. Then, the gradient of the loss value with respect to all trainable parameters in the model is derived in reverse, providing direction for parameter updates. The optimizer updates the model parameters accordingly. When the loss function values on the training set and the test set, and the evaluation metric (accuracy) are compared, the results are compared. P ), recall rate ( R ), average accuracy ( AP ) and mean precision ( mAP When the parameters (accuracy, accuracy, etc.) tend to stabilize and no longer improve, it indicates that the model has converged, and the optimal model parameters at this point are saved. P Recall rate R Average accuracy AP and mean precision mAP The calculation formula is as follows: (twenty two); (twenty three); (twenty four); (25); In the above formula, TP (True Positive) is the number of true positives, that is, the number of positive samples that are correctly predicted; FP (False Positive) is the number of false positives, that is, the number of negative samples that are incorrectly predicted as positive. FN (FalseNegative) represents the number of false negatives, i.e., the number of positive samples that are incorrectly predicted as negative; the parameter n represents the total number of target classes in the dataset. i The index representing the target category.
[0017] This invention discloses a modeling method for detecting defects in insulators of high-voltage transmission lines using unmanned aerial vehicles (UAVs) based on YOLOv11n. The technical effects are as follows: 1) In the preprocessing part of the original image of high-voltage transmission line insulators, the present invention uses the Retinex image enhancement algorithm. By separating the illumination and reflection components, it specifically solves the detection difficulties caused by environmental factors such as illumination distortion, loss of dark defects, and uneven illumination in outdoor inspection images. This provides richer and more significant feature information for subsequent deep learning models, directly helping to accurately detect small targets and reduce the false negative rate.
[0018] 2) The DWConv convolution module is used in the backbone network to decouple the two tasks of spatial filtering and channel fusion, thereby maximizing computational efficiency in the resource-constrained environment of UAVs.
[0019] 3) The RFCAConv convolutional module is used in the neck network. While maintaining extremely low computational overhead, it can significantly enhance the network's understanding of the spatial correlation of input features, enabling UAVs to more accurately identify key regions in images when inspecting insulators outdoors, and facilitating more focused analysis of key features.
[0020] 4) In the neck network, the C3k2 module in the head output section is replaced with the C3k2-DSConv module. Its convolution kernel can dynamically adjust its shape according to the target contour, covering a wider and more irregular area. Combined with dilated convolution and multi-scale fusion technology, the receptive field is made to better fit the target shape, thereby significantly expanding the effective recognition range. 5) A P2 detection layer is introduced before the small target detection layer. By fusing deep global information with shallow detailed features, more image details are effectively preserved, which greatly improves the model's ability to detect and recognize small targets.
[0021] 6) This invention introduces the Inner-SIoU loss function to specifically address the core problems in insulator defect detection, such as difficulty in locating small targets, poor adaptation to irregular shapes, easy confusion of dense defects, and significant impact of annotation noise. Ultimately, it achieves a comprehensive improvement in bounding box positioning accuracy, defect detection rate, and model stability.
[0022] 7) The improvements of this invention effectively address the core pain points of UAV-based insulator defect inspection, significantly improving detection accuracy and efficiency while greatly reducing computational overhead and enhancing the model's practicality and stability. This research not only provides an efficient solution for this field but also has significant implications for promoting technological progress in the industry. Attached Figure Description
[0023] The present invention will be further described below with reference to the accompanying drawings and examples; Figure 1 This is a flowchart of the modeling method of the present invention; Figure 2 This is a schematic diagram of the insulator defect detection model based on the improved YOLOv11n of the present invention.
[0024] Figure 3 This is a schematic diagram of the depth-separable convolutional (DWConv) structure of the present invention.
[0025] Figure 4 This is a schematic diagram of the RFCAConv convolution module structure of the present invention.
[0026] Figure 5 This is a schematic diagram of the receptive field attention RFA module structure of the present invention.
[0027] Figure 6 This is a schematic diagram of the squeeze-excitation SE attention module structure of the present invention.
[0028] Figure 7 This is a schematic diagram of the DSConv module structure of the present invention. Detailed Implementation
[0029] A modeling method for detecting insulator defects in high-voltage transmission lines using UAVs based on YOLOv11n includes: (I): Preprocessing of raw images of insulators taken by UAV: The dataset used in this embodiment consists of insulator images captured by a drone, containing four types of defect instances: normal, breakage, discharge, and self-explosion. To support the model's accurate identification and localization of defects, the dataset underwent the following preprocessing steps: First, the defect targets were bounding boxes using the LabelImg tool and assigned standardized labels "normal," "breakage," "discharge," and "self-explosion," respectively. This process generated a TXT file recording the category and location coordinates. Subsequently, data augmentation operations were performed on the dataset to increase data diversity and further improve the model's final detection accuracy. Finally, the processed insulator image dataset was divided into training, testing, and validation sets in an 8:1:1 ratio. In performing data augmentation operations on the dataset, this invention uses the Retinex image augmentation algorithm. The Retinex algorithm is based on the color constancy theory of the human visual system. Its fundamental principle is that the color perception of an object depends on its reflectivity to long-wavelength, medium-wavelength, and short-wavelength light, rather than the absolute intensity of the incident light. In contrast, traditional image augmentation methods often only target and enhance a single type of image feature. The Retinex algorithm, however, can comprehensively achieve dynamic range compression, edge enhancement, and color constancy, thus achieving adaptive enhancement effects for various images. Its evolution has resulted in various implementations, such as single-scale SSR, multi-scale MSR, and MSRCR with color restoration. Although these methods differ in specific strategies, they are all based on the core idea of multi-scale processing, aiming to optimize the brightness and color fidelity of images.
[0030] The single-scale SSR algorithm estimates the illumination component from the original image using a specific Gaussian surround function, and then separates the reflection component, which represents the essential properties of the object. This process is completed in the logarithmic domain through difference operations. Finally, image enhancement is achieved by reconstructing the reflection component, effectively compressing the dynamic range and improving the overall visual effect. The single-scale SSR algorithm can effectively compress the dynamic range of an image, enhance details, and achieve uniform illumination, enabling the capture of small scales to enhance details. The calculation formula is as follows: ; ; ; ; In the above formula, Represents the original image; Indicates the reflected component; Indicates the light component; Indicates a center-wrap function; Indicates the convolution scale; Indicates the Gaussian surround scale; This represents the output image of the single-scale SSR algorithm. Represents the convolution symbol.
[0031] The multi-scale MSR algorithm evolved from the SSR algorithm and boasts extremely high fidelity and dynamic range compression capabilities, effectively improving image quality. The calculation formula is as follows: ; In the formula, This represents the output image of the multi-scale MSR algorithm; Representing different weights; are Gaussian convolution functions of different scales; n is the number of Gaussian center wrapping functions. When n=1, the MSR algorithm is consistent with SSR.
[0032] The multi-scale MSRCR algorithm for color restoration incorporates a color restoration factor. This involves adjusting local areas of the image to compensate for color distortion caused by increased contrast. The calculation formula is as follows: ; In the formula, This represents the output image of the i-th channel after processing by the Color Restoration Multiscale MSRCR algorithm. The recovery factor represents the color of the nth channel, which is used to adjust the color ratio of the 3 channels, thereby highlighting the information in the relatively dark areas and eliminating the defects of image color distortion. This represents the image after multi-scale MSR algorithm enhancement of the i-th channel without color restoration adjustment.
[0033] (II): Improved model structure: This invention improves the model structure based on YOLOv11n to ensure high-precision identification of insulator defects during UAV inspections of high-voltage transmission line insulators with low computational resource consumption. The improved YOLOv11n insulator defect detection model structure is as follows: Figure 1 As shown.
[0034] The improved YOLOv11n insulator defect detection model mainly consists of three parts: Backbone, Neck, and Head. In the improved backbone, Depthwise Separable Convolution (DWConv) replaces the original standard convolution operation. By decomposing standard convolution into depthwise convolution and pointwise convolution, the model's total number of parameters and computational complexity are reduced. DWConv is decomposed into two sequential steps: first, depthwise convolution is performed, using a kernel equal to the number of input channels, independently performing spatial convolution on each input channel to efficiently extract spatial features; then, pointwise convolution is performed, fusing all output channels using a 1×1 kernel to learn cross-channel feature combinations. The output of the depthwise separable convolution is calculated as follows: ; ; In the formula, This represents the output of the depthwise convolution. This represents the output of pointwise convolution. Represents the depthwise convolution kernel. Represents the pointwise convolution kernel; X represents the input quantity; This represents a depthwise convolution operation; This represents a pointwise convolution operation; This invention proposes a novel neck network structure, RFADS, and introduces a P2 detection layer before the small target detection layer. The RFADS network structure first replaces the native YOLOv11 convolution with an RFCAConv convolution module. Then, the C3k2 module in the output part of the detection head is replaced with a C3k2-DSConv module, so that the receptive field fits the target shape better, thereby significantly expanding the effective recognition range. Furthermore, the RFCAConv convolutional module deeply integrates receptive field attention (RFA) and squeeze-excitement (SE) attention modules. While retaining the ability of RFA to finely model local features within the receptive field, it strengthens the selection of "key channel features" through the channel attention mechanism of the SE module, achieving synergy between "receptive field-level local optimization" and "channel-level global enhancement" while maintaining extremely low computational overhead. Preferably, the SE module is a classic channel attention mechanism. Its core uses "squeeze" and "excitation" operations to learn the importance weights between channels, thereby enhancing key channel features and suppressing redundant channels. Squeeze uses global average pooling to extract the spatial information of each channel. The value is compressed into a scalar, capturing the global response of that channel. For the compressed scalar of the k-th channel... The calculation formula is: ; In the formula, Represents the k-th channel and spatial location of the input feature map. The feature values. After compression, a channel descriptor vector is obtained: ; The excitation step processes the channel descriptor S through a lightweight network ("dimensionality reduction-activation-dimensionality increase") to generate channel attention weights and model the dependencies between channels. Preferably, RFA not only focuses on the receptive field spatial features, but also provides effective attention weights for large-size convolutional kernels. The calculation formula is as follows: ; In the formula, express Grouped convolution, This indicates the size of the convolution kernel, and Norm represents normalization. X Indicates the input feature map, A Represents an attention map. F Indicates the spatial characteristics of the receptive field; Furthermore, the C3k2 module in the output section of the detection head is replaced with the C3k2-DSConv module, making the receptive field more closely match the target shape, thereby significantly expanding the effective recognition range. DSConv consists of concatenated depthwise convolution and pointwise convolution, completing feature extraction step by step. The depthwise convolution applies a convolution kernel independently to each channel of the input feature map, only responsible for capturing spatial relationships (such as edges and textures) within that channel, without involving information fusion between channels. The calculation formula for the c-th channel is as follows: ; In the formula, Indicates the output quantity. This represents one input channel corresponding to each convolutional kernel. X Indicates the input quantity; pointwise convolution uses The output of convolution versus depthwise convolution Perform inter-channel fusion and adjust the number of output channels to the target dimension. , No. The formula for calculating each output channel is as follows: ; In the formula, Y Indicates the output quantity. This represents the weights of the 1×1 convolution kernel used in pointwise convolution. Indicates the output of depthwise convolution; In insulator defect detection, the loss function is crucial to the model training effect. This invention introduces the Inner-SIoU loss function to improve the model's detection accuracy and robustness. Compared to the traditional IoU loss, the SIoU loss function has undergone a key extension, adding angle and shape constraints for the bounding box in addition to the cross-union ratio calculation. This comprehensive consideration strengthens the supervision of the predicted box regression process, enabling it to better cope with target rotation and deformation, ultimately exhibiting superior stability and robustness when handling complex targets. The expression is: ; ; In the formula, This represents the distance loss term, which measures the distance between the center points of the predicted bounding box and the ground truth bounding box, and is adjusted based on this distance. The shape loss term measures the shape difference between the predicted bounding box and the ground truth bounding box, especially the difference in aspect ratio. IoU is the standard intersection-union ratio (the degree of overlap between the predicted bounding box and the ground truth bounding box). Indicates the prediction box. Represents the true bounding box; when calculating IoU, Represents the center coordinates of the true bounding box. Indicates the center coordinates of the prediction box. and These represent the width and height of the actual bounding box, respectively. and Let represent the width and height of the prediction box, respectively. The formula for calculating the auxiliary boundary is: ; In the formula, This represents the left boundary of the auxiliary bounding box of the real bounding box. This represents the right boundary of the auxiliary bounding box of the real bounding box. This represents the upper boundary of the auxiliary bounding box of the real bounding box. This represents the lower boundary of the auxiliary bounding box of the real bounding box. This indicates the scaling ratio of the auxiliary box (used to adjust its size); the formula for calculating the predicted box is: ; In the formula, Indicates the left boundary of the prediction box. Indicates the right boundary of the prediction box. Indicates the upper boundary of the prediction box. This indicates the lower boundary of the prediction box. This indicates the scaling ratio of the auxiliary box (used to adjust its size); the formulas for calculating the intersection and union are: ; ; In the formula, inter represents the area of the intersection between the auxiliary boxes, and union represents the area of the union; therefore, the formula for Inner-IoU is: ; The formula for calculating the Inner-SloU loss function is: ; In the formula, It is the standard SIoU loss function. IoU It is the intersection-over-union ratio between the predicted bounding box and the ground truth bounding box. The internal intersection-union ratio is calculated using an auxiliary bounding box. (III): Set parameters and train the model using the dataset: The experiment was conducted on a workstation platform with the following configuration: Microsoft Windows 11 (64-bit) operating system, PyTorch deep learning framework, PyCharm development environment, and Python 3.8 and CUDA 11.8. The hardware core included an AMD Ryzen 5 1500X Quad-Core processor (3.50 GHz), 24GB of system memory, and an NVIDIA GeForce RTX 3060 graphics card with 12GB of video memory. The key hyperparameters for model training were set as follows: input image resolution fixed at 640×640, training epochs at 300, batch size at 64, SGD optimizer, and initial learning rate at 0.01.
[0035] In the model performance evaluation system, this invention selects precision, recall, mean precision, number of parameters, and computational cost as core indicators. Specifically: precision is used to evaluate the accuracy of the model's positive class prediction; computational cost is expressed in GFLOPs, and the numerical value of the model's computational complexity mAP reflects the model's performance; the larger the mAP, the better the target recognition ability. Detection time testing is conducted with a batch size of 1, recording the number of milliseconds required to process a single image.
[0036] After setting up the basic environment configuration, use the dataset to test and evaluate the model to obtain the best data model.
[0037] (iv): The optimal model is verified using a validation set to obtain an insulator defect detection model that meets the accuracy requirements. In this embodiment, to verify the effectiveness of the detection model proposed in this invention, we selected YOLOv11n, YOLOv10n, YOLOv8n, and YOLOv7-tiny as baseline models and compared their performance with the improved YOLOv11n model constructed in this invention on the same dataset. The evaluation results of each model are summarized in Table 1. Experiments show that the insulator defect detection model based on the improved YOLOv11n proposed in this invention outperforms other comparative models in terms of accuracy (P), recall (R), and mAP@0.5, while significantly reducing its computational complexity and the number of model parameters, demonstrating better practicality and deployment potential.
[0038]
[0039] The improved model reduces computational complexity and the number of parameters compared to the baseline model YOLOv11n, while achieving optimal results in key performance indicators. Considering all indicators, the detection model proposed in this invention is more suitable for UAV inspection of insulator defects in high-voltage transmission lines.
[0040] In summary, this invention presents a method for detecting defects in insulators of high-voltage transmission lines using unmanned aerial vehicles (UAVs) based on YOLOv11n. This method, through the application of the Retinex algorithm for data augmentation, comprehensively achieves dynamic range compression, edge enhancement, and color constancy, thereby achieving adaptive enhancement effects for various images.
[0041] In terms of the YOLOv11n model modification, in the backbone network, depthwise separable convolution (DWConv) was used to replace the original standard convolution operation. By decomposing the standard convolution into depthwise convolution and pointwise convolution, the aim is to reduce the total number of parameters and computational complexity of the model. This invention proposes a novel neck network structure, RFADS, which uses the RFCAConv convolutional module to deeply integrate receptive field attention (RFA) and squeeze-excitement (SE) attention modules. While retaining the ability of RFA to finely model local features within the receptive field, the channel attention mechanism of the SE module strengthens the selection of "key channel features", achieving the synergy of "receptive field-level local optimization" and "channel-level global enhancement" while maintaining extremely low computational overhead. The C3k2 module in the output section of the detection head is replaced with the C3k2-DSConv module, and a P2 detection layer is introduced before the small target detection layer, so that the receptive field fits the target shape better, thereby significantly expanding the effective recognition range. Finally, the Inner-SIoU loss function is introduced to improve the accuracy and robustness of the model's detection.
[0042] This invention achieves high-precision identification of insulator defects by deeply optimizing the YOLOv11n model structure and introducing innovative modules, while ensuring low computational resource consumption. This invention can effectively adapt to efficient inspection tasks in various complex field environments, significantly improving detection performance and practical value at edge devices.
Claims
1. A modeling method for a UAV inspection high-voltage transmission line insulator defect detection model based on YOLOv11n, characterized in that The method comprises the following steps: Step 1: collecting insulator defect images by a UAV, and pre-processing the insulator defect images to form a data set; Step 2: constructing an insulator defect detection model based on improved YOLOv11n; Step 3: training the insulator defect detection model based on improved YOLOv11n constructed in step 2 to obtain an optimal model; Step 4: verifying the accuracy of the optimal model constructed in step 3 by using a verification set to obtain an insulator defect detection model meeting the accuracy requirement.
2. The modeling method of the YOLOv11n-based unmanned aerial vehicle inspection high-voltage transmission line insulator defect detection model according to claim 1, characterized in that: In step 1, the aerial line insulator images collected by the UAV at high altitude are labeled by using a labeling tool LabelImg to add label information of insulator defects; specifically as follows: First, the aerial image is imported into the LabelImg tool and switched to YOLO format, then the defect area of the insulator in the image is accurately framed by using the rectangular framing function of the tool, the defect area includes normal, breakage, discharge and self-explosion, and corresponding labels are added to each defect area, including "normal", "breakage", "discharge" and "self_explosion", and after completing the labeling of a single image, a.txt label file containing defect category index and normalized coordinates is automatically generated.
3. The modeling method of the YOLOv11n-based unmanned aerial vehicle inspection high-voltage transmission line insulator defect detection model according to claim 2, characterized in that: The labeled insulator defect image is processed by using a Retinex image enhancement algorithm; The color recovery multi-scale MSRCR algorithm is adopted, and a color recovery factor is added in the color recovery multi-scale MSRCR algorithm The local region of the image is adjusted to compensate for the color distortion caused by the contrast enhancement, and the calculation formula is as follows: (6); In formula (6), represents the output image of the i-th channel after the color restoration multi-scale MSRCR algorithm processing; i represents the restoration factor of the i-th channel color, which is used to adjust the 3-channel color ratio, so as to highlight the information of the relatively dark area, and eliminate the defects of image color distortion; represents the image of the i-th channel after the multi-scale MSR algorithm enhancement processing without color restoration adjustment. 4. The modeling method of the YOLOv11n-based unmanned aerial vehicle inspection high-voltage transmission line insulator defect detection model according to claim 3, characterized in that: In step 2, the improved part of YOLOv11n specifically includes: 2.1: in the improved backbone network, a depth separable convolution DWConv is used to replace the original standard convolution operation, by decomposing the standard convolution into a depth convolution and a point-by-point convolution, aiming to reduce the total amount of model parameters and computational complexity; 2.2: a neck network structure RFADS is proposed, and a P2 detection layer is introduced before the small target detection layer; the neck network structure RFADS first uses an RFCAConv convolution module to replace the original convolution of YOLOv11; Then, the C3k2 module of the detection head output part is replaced by a C3k2-DSConv module, so that the receptive field is more in line with the target form, thereby significantly expanding the effective recognition range; 2.3: the Inner-SIoU loss function is introduced to make the detection of the model have higher accuracy and robustness.
5. The unmanned aerial vehicle inspection high-voltage transmission line insulator defect detection model modeling method based on YOLOv11n according to claim 4, characterized in that: In 2.1, the depth separable convolution DWConv is decomposed into two serial steps, first depth convolution, which uses a convolution kernel equal to the number of input channels to independently perform spatial convolution on each input channel to efficiently extract spatial features; Then, point-by-point convolution is performed, which fuses all the channels output by the foregoing by using a 1x1 convolution kernel to learn the feature combination across channels, and the output of the depth separable convolution DWConv is calculated as: (7); (8); In the above formulae, denotes the output quantity of a depth convolution, denotes the output quantity of a point-wise convolution, denotes a depth convolution kernel, denotes a point-wise convolution kernel; X denotes an input quantity; denotes a depth convolution operation; denotes a point-wise convolution operation.
6. The modeling method of the YOLOv11n-based unmanned aerial vehicle inspection high-voltage transmission line insulator defect detection model according to claim 4, characterized in that: 2.2 includes: 2.2.1: the RFCAConv convolution module deeply fuses the receptive field attention RFA and the SE attention module, while retaining the ability of the receptive field attention RFA to model the local features in the receptive field, the channel attention mechanism of the SE attention module is used to strengthen the selection of key channel features; The SE attention module learns the importance weight between channels through "Squeeze" and "Excitation" operations, realizes the enhancement of key channel features and the suppression of redundant channels; "Squeeze" compresses the spatial information of each channel into a scalar through global average pooling, capturing the global response of the channel; for the kth channel, the compressed scalar is The calculation formula is as follows: The calculation formula is as follows: (9); In formula (9), represents the feature value of the input feature map at the kth channel and the spatial position ; and a channel descriptor vector is obtained after compression. (10); In formula (10), denote the channel descriptor vectors obtained after the input feature map is subjected to the "squeeze" operation; denote the scalar values obtained after the 1st to the 64th channels in the input feature map are subjected to the "squeeze" operation, respectively; k denote the scalar values obtained after the 1st to the 64th channels in the input feature map are subjected to the "squeeze" operation, respectively; "Excitation" processes the channel descriptor S through a lightweight network to generate channel attention weights, modeling the inter-channel dependency; The receptive field attention RFA not only focuses on the spatial features of the receptive field, but also provides effective attention weights for large-size convolution kernels; the calculation formula is as follows: (11); In formula (11), denotes a grouped convolution with a size of denotes the size of the convolution kernel; Norm denotes normalization; X denotes an input feature map; A denotes an attention map; F denotes a receptive field spatial feature; denotes a normalized activation function; denotes a linear rectifier function; denotes a global average pooling operation on an input feature map X denotes normalization processing on an output result of a grouped convolution with a size of denotes a grouped convolution with a size of 2.2.2: Replace the C3k2 module in the output part of the detection head with a C3k2-DSConv module to make the receptive field more consistent with the target form, thereby significantly expanding the effective recognition range; The DSConv module is composed of a depth convolution and a pointwise convolution in series, and feature extraction is completed in steps; the depth convolution independently applies a convolution kernel to each channel of the input feature map, and the calculation formula of the cth channel is as follows: (12); In equation (12), Indicates the height of the output feature map; Indicates the width of the output feature map; The channel indices of the input and output feature maps; The offset representing the height of the convolution kernel; The offset representing the width of the convolution kernel; Indicates the kernel size used in depthwise convolution; After depthwise convolution, the spatial location of the c-th channel is... The output feature value; This indicates the position within the depthwise convolution kernel corresponding to the c-th channel. The weight value at the location; This represents the spatial location of the c-th channel in the input feature map. The original feature value at the location; Point-wise convolution Convolution on the output of depthwise convolution Inter-channel fusion, adjust the number of output channels to the target dimension , the th output channel calculation formula is as follows: (13); In formula (13), represents the final output feature value at the spatial position of the i-th output channel after point-wise convolution; represents the weight value of the corresponding input channel c to output channel in the 1x1 convolution kernel used; represents the output feature value of the depth convolution stage; represents the number of input channels of the point-wise convolution; represents the number of target output channels of the point-wise convolution. 7. The modeling method of the UAV inspection high-voltage transmission line insulator defect detection model based on YOLOv11n according to claim 4, characterized in that: In 2.3, the SIoU loss function adds angle and shape constraints for the bounding box in addition to the intersection over union calculation, and the expression is: (14); (15); In the formula, represents the calculation result of the SIOU loss function; represents a distance loss term, which measures the distance between the center points of the predicted frame and the real frame, and adjusts according to the distance; represents a shape loss term, which measures the shape difference between the predicted frame and the real frame, especially the difference in width-height ratio; IoU is the standard intersection over union, representing the degree of overlap between the prediction box and the real box; B represents the prediction box, represents the real box; when calculating IoU, represents the center coordinates of the real box, represents the center coordinates of the prediction box, represents the width and height of the real box, respectively, represents the width and height of the real box, respectively, represents the width and height of the prediction box, respectively, represents the width and height of the prediction box, respectively, and the calculation auxiliary boundary formula is: (16); In formula (16), represents a left boundary of the real box assisted bounding box, represents a right boundary of the real box assisted bounding box, represents an upper boundary of the real box assisted bounding box, represents a lower boundary of the real box assisted bounding box, represents a scaling ratio of the assisted box, used to adjust the size of the assisted box; for the prediction box, the calculation formula is: (17); In formula (17), represents the left boundary of the prediction frame, represents the right boundary of the prediction frame, represents the upper boundary of the prediction frame, represents the lower boundary of the prediction frame, represents the scaling ratio of the auxiliary frame, used to adjust the size of the auxiliary frame; the calculation formula of the intersection and the union is: (18); (19); In the above formula, inter is the intersection area between the auxiliary boxes; union is the union area; therefore, the formula for the internal intersection over union is: (20); In formula (21), represents the internal cross-over ratio.
8. The modeling method of the YOLOv11n-based unmanned aerial vehicle inspection high-voltage transmission line insulator defect detection model according to claim 7, characterized in that: The calculation formula of the Inner-SloU loss function is: (21); In formula (21), represents the Inner-SIoU loss function; is a standard SIoU loss function; IoU is the intersection over union between the predicted box and the real box; is the inner intersection over union calculated by the auxiliary bounding box.
9. The modeling method of the YOLOv11n-based unmanned aerial vehicle inspection high-voltage transmission line insulator defect detection model according to claim 8, characterized in that: A P2 detection layer is introduced before the small target detection layer; First, multi-scale features are extracted through modules such as DWConv and C3k2 in the backbone network part; when the feature processing reaches the P2 level, which is the highest resolution feature layer in the backbone network, the output is introduced into the RFADS module, and after feature refinement by C3k2-DSConv, it is directly connected to the corresponding Detect detection head, and information fusion is completed with the upper layer features through Concat operation, finally making the P2 layer participate in the target detection process in the neck network part as a new detection branch.
10. The modeling method of the UAV inspection high-voltage transmission line insulator defect detection model based on YOLOv11n according to claim 9, characterized in that: In step 3, the training set and the test set are used to train the improved YOLOv11n-based insulator defect detection model; During the training of the improved YOLOv11n-based insulator defect detection model, the hyperparameters are configured: Subsequently, the labeled training set and test set are input into the model, the prediction results including defect box coordinates and class probabilities are obtained through forward propagation, and the loss value is calculated with the labeled training set and validation set real labels, then the gradients of all trainable parameters in the model with respect to the loss value are derived in reverse, providing a direction for parameter update, and the model parameters are updated by the optimizer accordingly; When the loss function value on the training set and the test set and the evaluation indicators: accuracy ( P ), recall ( R ), average accuracy ( AP ), and average precision mean ( mAP ) all tend to be stable and no longer improve, it indicates that the model has converged, and the optimal model parameters at this time are finally saved; Accuracy P Recall R Mean Accuracy AP and Mean Precision mAP The calculation formulas are shown as follows: (22); (23); (24); (25); In the above formula, TP is the number of true examples, i.e., the number of positive samples that are correctly predicted; FP is the number of false positives, i.e., the number of negative samples that are incorrectly predicted as positive; FN is the number of false negatives, i.e., the number of positive samples that are incorrectly predicted as negative; The parameter n represents the total number of target classes in the data set; i An index representing a target class.
Citation Information
Cited By
A method and device for constructing a fault location model of a cable line infrared image
CN122156917A