Insulator defect detection method based on layered multi-scale adaptive fusion network
By using the HMSAF-YOLO model for multi-scale feature extraction and fusion, the problems of scale variation and complex background in insulator defect detection in UAV images are solved, achieving efficient and accurate insulator fault detection.
Patent Information
- Application Number
- CN202511632652.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2026-02-24
AI Technical Summary
Insulator defect detection in UAV images faces challenges such as extreme scale variations, complex backgrounds, and limited computing resources, making it difficult for existing methods to achieve efficient and accurate detection.
The HMSAF-YOLO model based on a hierarchical multi-scale adaptive fusion network is adopted. Multi-scale feature extraction is performed through the CSP_MSCAF module and the SPPF_LSKA module, feature fusion is performed by combining the HCAFN neck network, and the Inner_GIoU loss function is used to optimize the bounding box regression.
Efficient insulator defect detection was achieved on a UAV platform with limited computing resources, improving the detection accuracy of small defects and robustness in complex backgrounds, thus meeting the requirements for real-time detection.
Smart Images

Figure CN121564580A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of insulator defect detection technology, and particularly relates to an insulator defect detection method based on a hierarchical multi-scale adaptive fusion network. Background Technology
[0002] Power transmission lines are critical infrastructure for electricity transmission, and insulators, as core components providing electrical isolation and mechanical support, are exposed to complex outdoor environments for extended periods, making them prone to defects such as falling off, breaking, and flashover, severely impacting the fault-free operation of the lines. Once insulator defects occur, they not only lead to a decline in power supply quality but also pose a serious threat to the stability of the power system and public safety. Statistics show that over 75% of power grid accidents each year are caused by insulator defects, highlighting the urgency and importance of effective insulator testing.
[0003] In recent years, the use of drones for insulator defect detection has become a prominent research area in power transmission line inspection. The emergence of drone technology has fundamentally changed the way power line inspections are conducted by enabling remote, efficient, and safe monitoring of power transmission infrastructure. Drone inspection systems equipped with high-resolution cameras can capture detailed images of insulators from different angles. Compared with traditional manual and helicopter inspections, drone inspections significantly improve the inspection coverage and frequency due to their advantages such as wide coverage, high efficiency, good safety, cost-effectiveness, and environmental friendliness.
[0004] The development of automated insulator defect detection technology has gone through different technological stages. Early methods mainly relied on traditional image processing techniques, employing edge detection, texture analysis, and morphological operations. However, these methods are far from meeting the needs for high-precision, real-time detection of insulator defects in complex image backgrounds. The reliance on manually designed features particularly limits their adaptability to new defect types and environmental conditions.
[0005] The emergence of deep learning has fundamentally changed the ability to detect insulator defects. Convolutional Neural Networks (CNNs) have demonstrated superior feature learning capabilities compared to hand-designed features. Initially applied to classification tasks, they have gradually evolved into more complex detection frameworks. In recent years, the application of object detection frameworks, particularly the YOLO series, has accelerated due to its optimal balance between accuracy and speed. The introduction of YOLOv8, with its improved architecture and training strategies, set a new benchmark. Despite its significant progress, insulator defect detection in aerial images still faces several key challenges that limit its practical deployment effectiveness.
[0006] Capturing extreme scale variations in images captured by drones presents a fundamental challenge. In images inspected by drones, most insulators are medium-sized objects, while insulator defects are small. This multi-scale characteristic is particularly problematic for detecting small defects, where key features may occupy less than 32×32 pixels. Traditional feature pyramid networks typically fail to preserve fine-grained details during progressive downsampling operations, leading to missed detections of minute defects.
[0007] The complexity of the environment further increases the difficulty of detection. UAV image processing often faces challenges such as complex backgrounds and significant target interference. Insulator defect image samples with complex backgrounds typically include mountainous and river landscapes, and the similarity between the target and the background reduces distinguishability. In addition, the dense arrangement of insulators in the insulator string poses a significant challenge through mutual occlusion and repetitive patterns, which can confuse standard target detection algorithms.
[0008] Current methods struggle to meet the computational efficiency requirements of edge deployments. While desktop GPUs can process high-resolution images in real time, the limited computing resources on drone platforms necessitate significant model compression, often at the expense of detection accuracy. This trade-off between accuracy and efficiency remains a key obstacle to practical deployment. Summary of the Invention
[0009] To address the specific challenges of insulator fault detection, this invention proposes an insulator defect detection method based on a hierarchical multi-scale adaptive fusion network. By constructing an HMSAF-YOLO detection model, it is possible to achieve relatively high detection accuracy while ensuring high computational efficiency when deployed on UAV platforms with limited computing power.
[0010] To achieve the above objectives, the technical solution of the present invention is: an insulator defect detection method based on a hierarchical multi-scale adaptive fusion network, the steps of which are as follows:
[0011] Step 1: Collect a dataset of images of insulators in the transmission line using drone equipment, and label the insulator categories, including normal insulators, damaged insulators, and flashover insulators;
[0012] Step 2: Build the HMSAF-YOLO model, which consists of three parts: the backbone network, the neck network, and the detector. In the backbone network, a cross-stage partial multi-scale channel adaptive fusion CSP_MSCAF module and a fast spatial pyramid pooling SPPF_LSKA module with large kernel separation and attention are introduced to perform multi-scale feature extraction and feature enhancement. In the neck network, the pyramid region context module PRCM, the gated feature fusion module GFFM, and the cross-scale interpolation fusion module CSIF are combined to perform feature fusion.
[0013] Step 3: Train the HMSAF-YOLO model using the preprocessed insulator image dataset;
[0014] Step 4: Use the final detection model to detect insulator defects in the image to be tested and output the prediction results.
[0015] The preferred network architecture for the backbone and neck is as follows:
[0016] The backbone network comprises 5 Conv units, 4 CSP_MSCAF modules, and 1 SPPF_LSKA module. The input image sequentially passes through the first Conv unit, the second Conv unit, the first CSP_MSCAF module, the third Conv unit, the second CSP_MSCAF module, the fourth Conv unit, the third CSP_MSCAF module, the fifth Conv unit, the fourth CSP_MSCAF module, and the SPPF_LSKA module to obtain enhanced multi-scale features. Each Conv unit sequentially includes a two-dimensional convolutional layer, a batch normalization layer, and a Silu activation function.
[0017] The neck network comprises one PRCM module, three GFFM modules, two CSIF modules, three C2F modules, and two Conv units. Specifically: the output feature P3 of the second CSP_MSCAF module of the backbone network is input to both the second CSIF module and the PRCM module; the output feature P4 of the third CSP_MSCAF module of the backbone network is input to both the first CSIF module and the PRCM module; the output feature P5 of the SPPF_LSKA module of the backbone network is input to both the first GFFM module and the PRCM module; and the multi-scale features P3', P4', and P5' output by the PRCM module are input to the third GFFM module, the second GFFM module, and the first GFFM module, respectively. The output features of the first GFFM module are input into the first CSIF module. The output features of the first CSIF module are input into the second GFFM module. The output features of the second GFFM module are input into the second CSIF module. The output features of the second CSIF module are input into the third GFFM module. The output features of the third GFFM module are sequentially processed through the first C2F module and the sixth Conv unit, and then concatenated with the output features of the second GFFM module. The resulting first concatenated feature is sequentially processed through the second C2F module and the seventh Conv unit, and then concatenated with the output features of the first GFFM module. The resulting second concatenated feature is input into the third C2F module. The output features of the three C2F modules are respectively input into three detection heads for defect detection.
[0018] Preferably, the processing procedure of the CSP_MSCAF module is as follows:
[0019] The CSP_MSCAF module takes input features and passes them through a 1×1 convolutional unit. Then, it uses a Split operation to split the features along the channel dimension, resulting in two parts. ;feature Each output feature and feature obtained after stacking n MSCAF modules After concatenation, the output features of the CSP_MSCAF module are obtained through a 1×1 convolutional unit. Specifically, it is expressed as:
[0020] ;
[0021]
[0022] in, Represents a 1×1 convolutional unit. Indicates splicing, This represents the output feature of the nth MSCAF module. This represents the nth MSCAF module.
[0023] Preferably, the processing procedure of the MSCAF module is as follows:
[0024] MSCAF module input features Features are obtained through a 1×1 convolutional unit. Then it enters three parallel branches, three Separable convolutions with kernel sizes of 3×3, 5×5, and 7×7 were used to capture information at specific scales:
[0025] ;
[0026] ;
[0027] ;
[0028] in, , and The kernel size is represented by , , Depth convolution;
[0029] Input features The concatenated features are then concatenated with the output features of all three branches, and a 1×1 convolutional unit is used to compress the concatenated features to the desired output channel dimension. The resulting features are then... Channel-level statistics are calculated using global average pooling and global max pooling:
[0030]
[0031] ;
[0032] in, and These represent global average pooling and global max pooling, respectively. and All are fully connected layers with 1×1 convolutions. It is a ReLU activation function. It is the sigmoid activation function. This represents element-wise multiplication. For attention weights, The feature output is weighted for attention;
[0033] Introducing learnable parameters and Normalization is achieved through the softmax operation. and :
[0034] ;
[0035] Final output of the MSCAF module Form a residual connection with the original input:
[0036] .
[0037] Preferably, the SPPF_LSKA module integrates the LSKA module into the fast spatial pyramid pooling SPPF network; the multi-scale features input to the SPPF_LSKA module are sequentially passed through one Conv unit and three MaxPool2d layers, and the four output features obtained are concatenated. The concatenated features are then sequentially passed through one LSKA module and one Conv unit to finally obtain the enhanced multi-scale features.
[0038] Preferably, the processing procedure of the LSKA module is as follows:
[0039] The input features F of the LSKA module are sequentially processed through two cascaded convolutional units and one 1×1 convolutional unit, and then the output features of the LSKA module are obtained through an attention mechanism. :
[0040]
[0041]
[0042]
[0043] in: , These represent the output features of the two cascaded convolutions, , Let k and d represent 1D convolutions in the horizontal and vertical directions, respectively, where k is the kernel size and d is the dilation rate. Indicates rounding down. ⊙ represents a 1×1 convolutional unit, and ⊙ represents element-wise multiplication.
[0044] Preferably, the processing procedure of the PRCM module is as follows:
[0045] Transform operations are performed on the three input features P3, P4, and P5 at different scales to align the feature dimensions.
[0046] For the shallow feature P3, a two-stage transformation is applied to obtain the feature. :
[0047] ;
[0048] For the intermediate-scale feature P4, features are obtained through a 1×1 convolutional unit. :
[0049] ;
[0050] After performing spatial upsampling on the deep features P5, the features are obtained through a 1×1 convolutional unit. :
[0051] ;
[0052] in: Indicates bilinear upsampling. , These represent 1×1 convolutional units and 3×3 convolutional units, respectively.
[0053] The aligned features are then concatenated along the channel dimension to form a unified hybrid feature. :
[0054]
[0055] The RCA module is introduced to model directional context features using parallel horizontal and vertical pooling operations. :
[0056]
[0057] in, This indicates adaptive average pooling in the horizontal direction. This indicates adaptive average pooling in the vertical direction;
[0058] Spatial attention is computed through a series of grouped convolutions with striped kernels. First, group them. convolution Reduce channels to obtain features And apply batch normalization Features obtained with ReLU activation Then through grouping convolution Recovery Channel Acquisition Features Spatial attention is ultimately obtained by performing sigmoid activation. Attention computation follows a bottleneck structure with striped convolutions:
[0059]
[0060]
[0061]
[0062]
[0063] in: Represents the size of the band-shaped nucleus. Represents the sigmoid function;
[0064] Parallel to the attention path, through The deep convolutional layer extracts local features; the final output combines local features and global context through an attention mechanism to enhance the features. :
[0065] ;
[0066] Enhanced features will be achieved through channel separation. Reverting to their original scale representations P3', P4', and P5':
[0067]
[0068]
[0069]
[0070] Preferably, the processing procedure of the GFFM module is as follows:
[0071] The input low-level features contain fine-grained spatial details and high-level features of encoded semantic information Intermediate representations are generated by performing convolutional transformations. , :
[0072] ;
[0073] ;
[0074] Among them, the output features P3 of the second CSP_MSCAF module, P4 of the third CSP_MSCAF module, and P5 of the SPPF_LSKA module are low-level features containing fine-grained spatial details, while the output features P3', P4', and P5' of the PRCM module are high-level features encoding semantic information. This represents a 1×1 convolutional unit without an activation function;
[0075] The final fused features are obtained by combining the transformed low-level features with the gated high-level features. Element-wise multiplication yields:
[0076]
[0077] .
[0078] in: Represents the hard-Sigmoid function. This represents the ReLU6 activation function.
[0079] Preferably, the processing procedure of the CSIF module is as follows:
[0080] For low-resolution features of the input and high-resolution features , , ,in, These represent the number of channels and spatial dimension of the high-resolution feature, respectively. These represent the number of channels and spatial dimension of the low-resolution feature, respectively, with scale i having a higher resolution than scale j;
[0081] Low-resolution features Features are obtained through bilinear interpolation. To match the spatial dimensions of high-resolution features:
[0082] ;
[0083] in This represents the bilinear interpolation operation;
[0084] After spatial alignment, features Learnable channel transformation is performed using 1×1 convolutional units and combined with high-resolution features. Perform additive fusion to obtain the output features of the CSIF module :
[0085] .
[0086] Preferably, the model training uses the Inner_GIOU loss function to achieve adaptive optimization for samples with different degrees of overlap. The calculation process of the Inner_GIOU loss function is as follows:
[0087] Auxiliary bounding boxes are generated based on the scaling factor ratio to predict the bounding boxes. Coordinates of the four vertices , , , :
[0088] ;
[0089] ;
[0090] in, This indicates the coordinates of the center point of the prediction box. and These represent the width and height of the prediction box, respectively;
[0091] Perform the same operation on the truth box to obtain the auxiliary bounding box of the truth box. Coordinates of the four vertices , , , ;
[0092] Calculate the cross-union ratio (CUI) between the auxiliary bounding boxes of the predicted bounding boxes and the ground truth bounding boxes. :
[0093]
[0094] ;
[0095] ;
[0096] in: and These represent the width and height of the truth box, respectively. This represents the intersection between the auxiliary bounding boxes of the predicted bounding box and the ground truth bounding box. This represents the union of the auxiliary bounding boxes between the predicted bounding boxes and the ground truth bounding boxes.
[0097] Inner-GIoU introduces a minimum bounding box. The concept and calculation formula are as follows:
[0098] ;
[0099] ;
[0100] ;
[0101] in, This represents the smallest bounding box that encloses the two auxiliary bounding boxes. and express Width and height, express The area of the region after removing the union of the two auxiliary bounding boxes. This represents the generalized intersection-union ratio of the final output;
[0102] Finally, the Inner-GIoU loss function Defined as:
[0103] .
[0104] Compared with the prior art, the present invention has the following beneficial effects:
[0105] 1) To address the problem of extreme scale variations in UAV images, a CSP_MSCAF (Cross Stage Partial Multi-Scale Channel-wise Adaptive Fusion) module was designed in the backbone network. This module employs parallel multi-scale convolutional branches (3×3, 5×5, and 7×7 convolutional kernels) combined with a channel-adaptive attention mechanism, enabling it to simultaneously capture features of different granularities and adaptively learn the relative importance of features at each scale. Furthermore, the SPPF_LSKA (Spatial Pyramid Pooling Fast with Large Separable Kernel Attention) module was integrated, which expands the receptive field and captures long-range dependencies through a large separable kernel attention mechanism, crucial for understanding the structural context of the complete insulator string.
[0106] 2) A Hierarchical Cross-Attention Fusion Neck (HCAFN) network is proposed, which achieves intelligent fusion of multi-scale features through a hierarchical cross-attention mechanism. HCAFN consists of three collaborative components: a Pyramid Region Context Module (PRCM) that captures directional spatial dependencies through region-aware attention; a Gated Feature Fusion Module (GFFM) that selectively combines features from different levels using an adaptive gating mechanism to effectively suppress noise and redundant information; and a Cross-Scale Interpolation Fusion Module (CSIF) that preserves high-frequency details during scale transformations through learnable residual connections. This hierarchical fusion strategy ensures the preservation of fine-grained spatial details while incorporating deep semantic information, significantly improving the detection performance of small-scale defects.
[0107] 3) An Inner_GIoU loss function is introduced to enhance the accuracy and stability of bounding box regression. This loss function provides a scale-adaptive optimization strategy for targets of different sizes through an auxiliary bounding box mechanism (ratio parameter) and generalized IoU calculation, while ensuring that effective gradient signals are generated even when the bounding boxes have low overlap. This adaptive regression mechanism is particularly suitable for handling irregular shapes and ambiguous boundaries commonly encountered in insulator fault detection.
[0108] 4) The proposed HMSAF-YOLO model achieves excellent performance while maintaining real-time detection capabilities. It has significantly improved in terms of small defect detection accuracy, robustness against complex backgrounds, and computational efficiency, providing an effective solution for the practical deployment of intelligent insulator inspection systems. Attached Figure Description
[0109] Figure 1 This is a flowchart of the present invention;
[0110] Figure 2 This is a structural diagram of the HMSAF-YOLO model of the present invention;
[0111] Figure 3 This is a structural diagram of the CSP_MSCAF module of the present invention;
[0112] Figure 4 This is a structural diagram of the SPPF_LSKA module of the present invention. Detailed Implementation
[0113] The following is in conjunction with the appendix Figure 1-4 The technical solution of the present invention will be described in detail below.
[0114] This invention proposes an insulator defect detection method based on a hierarchical multi-scale adaptive fusion network, which can be applied to insulator defect detection in complex aerial images. It addresses the challenges faced in insulator fault detection during UAV-based power line inspections. The steps are as follows:
[0115] Step 1: Collect an image dataset of insulators in the transmission line using drone equipment, and label the insulators into categories, including labeling normal insulators, damaged insulators, and flashover insulators in PASCAL VOC format using professional labeling software; then preprocess the dataset by performing data augmentation operations such as Mosaic enhancement, random horizontal flipping, random scaling, and HSV enhancement.
[0116] Step 2: Build the HMSAF-YOLO model, which consists of three parts: the backbone network, the neck network, and the detector. In the backbone network, a cross-stage partial multi-scale channel adaptive fusion CSP_MSCAF module and a fast spatial pyramid pooling SPPF_LSKA module with large kernel separation and attention are introduced to perform multi-scale feature extraction and feature enhancement. In the neck network, the pyramid region context module PRCM, the gated feature fusion module GFFM, and the cross-scale interpolation fusion module CSIF are combined to perform feature fusion.
[0117] Step 3: Train the HMSAF-YOLO model using the preprocessed insulator image dataset;
[0118] The preprocessed dataset is input into the HMSAF-YOLO backbone network for feature extraction: multi-scale features are obtained by using the cross-stage partial multi-scale channel adaptive fusion CSP_MSCAF module, and multi-scale features are enhanced by using the fast spatial pyramid pooling SPPF_LSKA module with large kernel separation kernel attention.
[0119] Multi-scale features are input into the neck network of HMSAF-YOLO for feature extraction and fusion: the Pyramid Region Context Module (PRCM) is used to enhance the context modeling of multi-scale features; the Gated Feature Fusion Module (GFFM) is used to selectively fuse features at different levels to suppress noise and highlight important information; and the Cross-Scale Interpolation Fusion Module (CSIF) is used to achieve cross-scale feature alignment and preserve spatial details.
[0120] The fused features are input into the HMSAF-YOLO detection head detect for target recognition. The Inner_GIOU loss function is proposed to achieve adaptive optimization for samples with different degrees of overlap, ensuring that effective gradients can still be provided when the boxes do not overlap, so as to accelerate model convergence.
[0121] Step 4: Use the final detection model to detect insulator defects in the image to be tested and output the prediction results.
[0122] This embodiment proposes an enhanced target detection framework—HMSAF-YOLO (Hierarchical Multi-Scale Adaptive FusionYOLO)—specifically designed for the accurate and efficient detection of insulators and their faults in aerial images. For example... Figure 2 As shown, the proposed HMSAF-YOLO architecture employs a three-stage detector design consisting of a backbone network, a neck network, and a detection head.
[0123] The backbone network serves as the foundation for hierarchical feature extraction, progressively generating multi-scale feature representations at different spatial resolutions. To enhance the model's ability to capture multi-scale features and adapt to significant scale variations encountered in UAV images, a CSP_MSCAF (Cross Stage Partial Multi-Scale Channel-wise Adaptive Fusion) module is introduced into the backbone network. This module employs parallel multi-scale convolutional branches (3×3, 5×5, and 7×7 convolutional kernels) combined with a channel attention mechanism to extract and adaptively fuse features at different granularities. Furthermore, an SPPF_LSKA (Spatial Pyramid Pooling Fast with Large Separable Kernel Attention) module is integrated at the bottom of the backbone network to expand the receptive field and capture long-range dependencies, which is crucial for understanding the structural context of the complete insulator string.
[0124] The neck network is responsible for aggregating and refining features from different backbone layers to facilitate multi-scale object detection. A proposed Hierarchical Cross-Attention Fusion Neck (HCAFN) replaces the traditional feature pyramid network. HCAFN consists of three collaborative components: a Pyramid Region Context Module (PRCM) for capturing directional spatial dependencies, a Gated Feature Fusion Module (GFFM) for selective feature combination via an adaptive gating mechanism, and a Cross-Scale Interpolation Fusion Module (CSIF) for information-preserving feature fusion across resolution levels. This hierarchical fusion strategy ensures the preservation of fine-grained spatial details while incorporating semantic information from deeper layers, significantly improving the detection performance of small-scale defects.
[0125] The detection head maintains an efficient decoupled head design, separating classification and localization tasks for better performance. To further improve bounding box regression accuracy, the Inner_GIoU loss function is adopted. This function introduces an auxiliary bounding box mechanism, providing a scale-adaptive optimization strategy for targets of different sizes, while maintaining effective gradient signals even in low-overlap scenes.
[0126] The complete HMSAF-YOLO pipeline processes the input image through the following stages: (1) the backbone network extracts enhanced multi-scale features through the CSP_MSCAF and SPPF_LSKA modules; (2) the HCAFN neck intelligently aggregates these features through a hierarchical cross-attention mechanism; and (3) the detection head generates predictions with accurate bounding boxes under the guidance of Inner_GIoU loss. This integrated design enables HMSAF-YOLO to achieve excellent detection accuracy while maintaining computational efficiency suitable for deployment on UAV platforms with limited computing resources.
[0127] Traditional YOLO backbone architectures primarily rely on sequential convolutional layers and standard residual blocks. These structures often struggle to capture fine-grained features of small targets while maintaining robust representation of large-scale targets. This limitation is particularly pronounced in dense target detection scenarios. To address these challenges, this application proposes a novel feature extraction module, CSP_MSCAF, to reconstruct the backbone network architecture. The backbone network comprises 5 Conv units, 4 CSP_MSCAF modules, and 1 SPPF_LSKA module. The input image sequentially passes through the first Conv unit, the second Conv unit, the first CSP_MSCAF module, the third Conv unit, the second CSP_MSCAF module, the fourth Conv unit, the third CSP_MSCAF module, the fifth Conv unit, the fourth CSP_MSCAF module, and the SPPF_LSKA module to obtain enhanced multi-scale features. Each Conv unit sequentially includes a 2D convolutional layer, a batch normalization layer, and a Silu activation function.
[0128] The neck network comprises one PRCM module, three GFFM modules, two CSIF modules, three C2F modules, and two Conv units. Specifically: the output feature P3 of the second CSP_MSCAF module of the backbone network is input to both the second CSIF module and the PRCM module; the output feature P4 of the third CSP_MSCAF module of the backbone network is input to both the first CSIF module and the PRCM module; the output feature P5 of the SPPF_LSKA module of the backbone network is input to both the first GFFM module and the PRCM module; and the multi-scale features P3', P4', and P5' output by the PRCM module are input to the third GFFM module, the second GFFM module, and the first GFFM module, respectively. The output features of the first GFFM module are input into the first CSIF module. The output features of the first CSIF module are input into the second GFFM module. The output features of the second GFFM module are input into the second CSIF module. The output features of the second CSIF module are input into the third GFFM module. The output features of the third GFFM module are sequentially processed through the first C2F module and the sixth Conv unit, and then concatenated with the output features of the second GFFM module. The resulting first concatenated feature is sequentially processed through the second C2F module and the seventh Conv unit, and then concatenated with the output features of the first GFFM module. The resulting second concatenated feature is input into the third C2F module. The output features of the three C2F modules are respectively input into three detection heads for defect detection.
[0129] The CSP_MSCAF module is built upon the concept of cross-stage partial networks and integrates the proposed MSCAF to enhance feature extraction capabilities. For example... Figure 3 As shown, its overall architecture follows a "split-transform-merge" paradigm. The input feature map is first divided into two parallel paths through channel splitting. The first path preserves features through identity mapping and performs residual calculations, while the second path undergoes sequential transformations through n MSCAF modules. Finally, all paths are concatenated and fused through a single convolutional layer. This design not only reduces computational redundancy but also enriches the feature representation through diverse processing paths. The specific processing procedure of the CSP_MSCAF module is as follows:
[0130] The CSP_MSCAF module takes input features and passes them through a 1×1 convolutional unit. Then, it uses a Split operation to split the features along the channel dimension, resulting in two parts. ;feature Each output feature and feature obtained after stacking n MSCAF modules After concatenation, the output features of the CSP_MSCAF module are obtained through a 1×1 convolutional unit. Specifically, it is expressed as:
[0131] ;
[0132]
[0133] in, Represents a 1×1 convolutional unit. Indicates splicing, This represents the output feature of the nth MSCAF module. This represents the nth MSCAF module.
[0134] The MSCAF module comprises two key stages: multi-scale feature extraction and adaptive attention fusion. First, the input features are channel-expanded using a 1×1 convolution to increase representational power. Then, the MSCAF module employs three parallel branches, using depthwise separable convolutions with kernel sizes of 3×3, 5×5, and 7×7 to capture information at specific scales: smaller kernels focus on local fine-grained details, while larger kernels capture broader contextual information. The mathematical formula for each branch follows a "neck" structure, where two 1×1 convolutions enclose a depthwise convolution. The specific processing steps of the MSCAF module are as follows:
[0135] MSCAF module input features Features are obtained through a 1×1 convolutional unit. Then it enters three parallel branches, three Separable convolutions with kernel sizes of 3×3, 5×5, and 7×7 were used to capture information at specific scales:
[0136] ;
[0137] ;
[0138] ;
[0139] in, , and The kernel size is represented by , , The depthwise convolution strategy significantly reduces computational complexity while maintaining feature extraction capabilities, making the module both efficient and effective.
[0140] Following multi-scale feature extraction, a channel-adaptive fusion strategy is employed to integrate multi-scale features from three parallel branches. Unlike simple equal-weight fusion methods, this design enables the model to automatically learn the relative importance of features at different scales through a channel attention mechanism. This adaptive fusion process comprises two key parts: feature concatenation and channel attention reweighting.
[0141] Input features The concatenated features are combined with the output features of all three branches to preserve the original feature information while incorporating multi-scale contextual features. This direct concatenation operation, though computationally simple, creates a feature-rich representation containing redundant and complementary information across different receptive field scales. To reduce dimensionality and prepare for subsequent attention operations, 1×1 convolutional units are used to compress the concatenated features to the desired output channel dimension. The core of channel adaptive fusion lies in the subsequent channel attention mechanism, which dynamically learns to emphasize information-rich channels while suppressing less discriminative channels. Channel-level statistics are calculated using global average pooling and global max pooling to capture complementary aspects of the feature distribution.
[0142]
[0143] ;
[0144] in, and These represent global average pooling and global max pooling, respectively. and All are fully connected layers with 1×1 convolutions (reduction rate of 4). It is a ReLU activation function. It is the sigmoid activation function. This represents element-wise multiplication. For attention weights, Feature output weighted for attention; attention weights The importance of each channel is effectively encoded, enabling the model to selectively amplify channels containing key detection-related features while attenuating noisy or redundant channels.
[0145] To further enhance the model's adaptability, learnable parameters are introduced. and Normalization is achieved through the softmax operation. and The contributions of weighted attention-refined features and direct compressed features:
[0146] ;
[0147] This learnable weighting mechanism provides an additional degree of freedom, allowing the network to automatically balance directly compressed features (preserving comprehensive multi-scale information) and attention-enhanced features (emphasizing task-relevant channels) based on specific detection requirements and input characteristics. During training, the model learns... and The optimal value is found to maximize detection performance, effectively creating a soft gating mechanism that adapts to different scenarios.
[0148] Final output of the MSCAF module Form a residual connection with the original input:
[0149]
[0150] In summary, the key to the CSP_MSCAF module lies in its adaptive multi-scale feature learning concept. Employing a parallel multi-branch architecture with deep separable convolutions in a "neck" structure, it efficiently extracts features from different receptive field scales simultaneously, addressing the fundamental challenge of detecting targets with significant size variations. More importantly, the channel-adaptive fusion mechanism distinguishes this method from traditional multi-scale architectures: by applying channel attention to the concatenated multi-scale features, the model implicitly learns to balance the contributions of different receptive field branches, achieving adaptive receptive field selection that dynamically adapts to input features. A learnable balance mechanism between directly compressed features and attention-enhanced features further enhances the model's flexibility, enabling it to automatically adapt to diverse detection scenarios. By strategically integrating the CSP_MSCAF module into the YOLOv8 backbone network, the improved architecture achieves superior multi-scale feature representation while maintaining computational efficiency, resulting in a significant improvement in the detection accuracy of targets at different scales.
[0151] The SPPF_LSKA module integrates the LSKA module into the fast spatial pyramid pooling SPPF network. The multi-scale features input to the SPPF_LSKA module are sequentially passed through one Conv unit and three MaxPool2d layers, and the four output features are concatenated. The concatenated features are then sequentially passed through one LSKA module and one Conv unit to finally obtain the enhanced multi-scale features.
[0152] The LSKA module operates through a complex attention mechanism that decomposes traditional 2D depth convolutions into separable 1D convolutions. The specific processing procedure of the LSKA module is as follows:
[0153] The input features F of the LSKA module are sequentially processed through two cascaded convolutional units and one 1×1 convolutional unit, and then the output features of the LSKA module are obtained through an attention mechanism. :
[0154]
[0155]
[0156]
[0157] in: , These represent the output features of the two cascaded convolutions, , Let k and d represent 1D convolutions in the horizontal and vertical directions, respectively, where k is the kernel size and d is the dilation rate. This indicates rounding down; this decomposition strategy reduces the number of parameters from... Reduce to It achieves linear complexity, rather than exhibiting quadratic growth with increasing kernel size. ⊙ represents a 1×1 convolutional unit, and ⊙ represents element-wise multiplication. This attention mechanism achieves adaptive feature refinement by emphasizing information-rich spatial locations while suppressing irrelevant regions.
[0158] Insulator inspection presents a unique challenge: models must simultaneously capture the fine-grained details of individual insulator discs and understand the broader structural context of the complete insulator string. The hierarchical nature of insulator assemblies, combined with extreme scale variations at different viewing distances, necessitates enhanced global contextual understanding to effectively correlate local features with the overall structure. This requirement is particularly critical when detecting subtle defects or damage modes.
[0159] To meet this specific requirement, the LSKA module was integrated into the Fast Spatial Pyramid Pooling (SPPF) architecture, creating a novel SPPF_LSKA module. Figure 4 As shown, the SPPF_LSKA architecture leverages the synergistic effect of multi-scale pooling and large-kernel attention. The SPPF component extracts multi-scale features through cascaded max-pooling operations, then concatenates these features to form a rich feature representation. By applying LSKA to these fused features, the module performs adaptive attention weighting, highlighting the most discriminative information across all scales. This design achieves dual receptive field expansion: SPPF expands the receptive field through pooling operations, while LSKA further expands it through large-kernel convolution. This collaborative effect enables more comprehensive global context modeling while preserving the fine-grained local details required for accurate insulator detection. Through this integration, SPPF_LSKA effectively addresses the fundamental challenge of balancing multi-scale contextual understanding with local accuracy, which is crucial for detecting anomalies in complete insulator strings and individual discs in complex power transmission environments.
[0160] Pyramid Region Context Module: Traditional multi-scale fusion methods in the YOLO neck network have limited context-aware capabilities, especially when dealing with targets exhibiting different regional features at different scales. Standard connection and addition operations cannot effectively model spatial dependencies and contextual relationships within multi-scale features, leading to insufficient representation of small targets in complex scenes. To overcome this limitation, the Pyramid Region Context Module (PRCM) is proposed. This module employs parallel multi-resolution processing streams and an adaptive region-aware attention mechanism to enhance contextual feature extraction at different scales.
[0161] The PRCM module accepts feature maps at three different scales, P3, P4, and P5, as input, corresponding to 1 / 8, 1 / 16, and 1 / 32 resolution of the original image size, respectively. For each input scale, a specific transformation operation is applied to align the feature dimensions while preserving scale-specific information. The processing procedure of the PRCM module is as follows:
[0162] Transform operations are performed on the three input features P3, P4, and P5 at different scales to align the feature dimensions.
[0163] A two-stage transformation is applied to the shallow feature P3, which contains the finest spatial details, to preserve representational power while performing spatial downsampling, thus obtaining the features. :
[0164] ;
[0165] The first 3×3 convolution with a stride of 2 halves the spatial resolution and compresses the channels to C3 / 2, followed by a 1×1 convolution that restores the channel dimension to C3. This design enables efficient spatial alignment with P4 features while preserving key information through the bottleneck of the intermediate channels.
[0166] For features at intermediate scales, P4 uses 1×1 convolutional units to preserve the feature representation without changing the spatial dimensions, thus obtaining the features. :
[0167] ;
[0168] After spatial upsampling of the deep features P5 containing high-level semantic information to align with the intermediate resolution, features are obtained through 1×1 convolutional units. :
[0169] ;
[0170] in: Indicates bilinear upsampling. , These represent 1×1 convolutional units and 3×3 convolutional units, respectively.
[0171] The aligned features are then concatenated along the channel dimension to form a unified hybrid feature. :
[0172]
[0173] A Region-Aware Contextual Attention (RCA) mechanism is introduced to capture spatial dependencies and enhance the discriminative power of region features. The RCA module employs parallel horizontal and vertical pooling operations to model directional contextual features. :
[0174]
[0175] in, This indicates adaptive average pooling in the horizontal direction. This indicates adaptive average pooling in the vertical direction;
[0176] Spatial attention is computed through a series of grouped convolutions with striped kernels. First, group them. convolution Reduce channels to obtain features And apply batch normalization Features obtained with ReLU activation Then through grouping convolution Recovery Channel Acquisition Features Spatial attention is ultimately obtained by performing sigmoid activation. Attention computation follows a bottleneck structure with striped convolutions:
[0177]
[0178]
[0179]
[0180]
[0181] in: This represents the size of the band-shaped nucleus (usually 11). represent function;
[0182] The channel compression strategy significantly reduces computational complexity while maintaining the effectiveness of the attention mechanism in capturing directional spatial dependencies.
[0183] Parallel to the attention path, through The deep convolutional layer extracts local features; the final output combines local features and global context through an attention mechanism to enhance the features. :
[0184] ;
[0185] Enhanced features will be achieved through channel separation. The segments are reconstructed to their original scale representations P3', P4', and P5', enabling subsequent processing stages to effectively utilize local details and global contextual information.
[0186]
[0187]
[0188] .
[0189] Gated Feature Fusion Module: Traditional feature fusion strategies in the YOLO neck architecture typically employ direct concatenation or addition operations, which treat all features equally regardless of their importance or relevance. This uniform processing often leads to feature perturbation; noise and irrelevant information from one scale can degrade the quality of features at another scale. To address this critical limitation, the Gated Feature Fusion Module (GFFM) is proposed. This module introduces an adaptive gating mechanism that selectively combines features from different levels based on their contextual importance.
[0190] The GFFM module takes two feature maps as input: a low-level feature map containing fine-grained spatial details. High-level feature maps that encode semantic information The core lies in the adaptive gating mechanism, which learns to dynamically weight the contribution of each feature stream. The processing procedure of the GFFM module is as follows:
[0191] The input low-level features contain fine-grained spatial details and high-level features of encoded semantic information Intermediate representations are generated by performing convolutional transformations. , :
[0192] ;
[0193] ;
[0194] Among them, the output features P3 of the second CSP_MSCAF module, P4 of the third CSP_MSCAF module, and P5 of the SPPF_LSKA module are low-level features containing fine-grained spatial details, while the output features P3', P4', and P5' of the PRCM module are high-level features encoding semantic information. This represents a 1×1 convolutional unit without an activation function. The Conv operation here includes convolution and batch normalization, but without an activation function (act=False), which allows the subsequent gating mechanism to learn more flexible feature combinations.
[0195] The gate signal is computed using a hard sigmoid activation function applied to the transformed high-level features. This provides computational efficiency while preserving gradient flow, and is expressed as:
[0196] ;
[0197] This formula ensures that the gating value remains between 0 and 1, effectively controlling the information flow of each stream. The final fused features are obtained by combining the transformed low-level features with the gated high-level features. Element-wise multiplication yields:
[0198]
[0199] .
[0200] in: This represents the hard-sigmoid function. This represents the ReLU6 activation function.
[0201] Gating mechanisms enable the network to adaptively suppress irrelevant features while amplifying information-rich features, resulting in more discriminative feature representations. Precise feature selection is crucial for accurate localization. The symmetric transformation of the two input features through convolution ensures that the fusion process considers characteristics at both levels equally, while the gating mechanism provides the necessary selectivity for optimal information integration.
[0202] Cross-Scale Interpolation Fusion Module: Traditional multi-scale fusion methods in object detection networks often rely on simple upsampling or downsampling operations to align features at different scales, which can lead to significant information loss and aliasing artifacts. Naive interpolation strategies fail to preserve fine-grained details during scale transformations, which is particularly problematic for small object detection, as each pixel carries crucial information. To overcome these limitations, the Cross-Scale Interpolation Fusion Module (CSIF) is introduced. This module employs learnable cross-scale transformations to achieve information-preserving feature fusion across different resolution levels.
[0203] The CSIF module operates on feature pairs at adjacent scales. The specific processing procedure of the CSIF module is as follows:
[0204] For low-resolution features of the input and high-resolution features , , ,in, These represent the number of channels and spatial dimension of the high-resolution feature, respectively. represents the number of channels and spatial dimension of low-resolution features, respectively, with scale i having a higher resolution than scale j; this module addresses the scale alignment challenge through a carefully designed sequence of operations that prioritizes the preservation of spatial details.
[0205] Low-resolution features Features are obtained through bilinear interpolation. To match the spatial dimensions of high-resolution features:
[0206] ;
[0207] in This indicates a bilinear interpolation operation; bilinear interpolation ensures a smooth spatial transformation while avoiding the checkerboard artifacts common in learning upsampling methods.
[0208] After spatial alignment, features Learnable channel transformation is achieved through 1×1 convolutional units:
[0209] ;
[0210] This sequence of operations—interpolation followed by convolution—is crucial for maintaining spatial consistency. By performing interpolation first, the spatial structure of low-resolution semantic features is ensured to be properly expanded before channel transformation. The subsequent 1×1 convolution not only aligns the channel dimensions but also learns scale-specific transformation weights that optimize the fusion process for object detection, enabling the network to adaptively combine spatial and semantic information from different levels.
[0211] Finally, with high-resolution features Perform additive fusion to obtain the output features of the CSIF module It preserves high-frequency details during scale alignment:
[0212]
[0213] This formula ensures that fine-grained spatial information from the high-resolution stream is preserved while incorporating semantic context from the low-resolution stream. This additive fusion strategy prevents information dilution that can occur with connection-based methods, and is particularly important for small object detection where subtle features must be preserved.
[0214] The complete CSIF pipeline incorporates multiple fusion stages within its feature hierarchy, creating a rich multi-scale representation that captures both local details and global context. The learned transform weights adapt to the specific characteristics of small target images of insulators, effectively addressing the unique challenges posed by thermal features and low contrast ratios. Through this adaptive cross-scale fusion mechanism, the CSIF module significantly enhances the network's ability to detect targets across a wide scale range, while maintaining computational efficiency through its lightweight design.
[0215] To enhance the network's generalization ability across different detection scenarios and mitigate IoU fluctuations caused by pixel-level errors during bounding box regression, an Inner-GIoU loss function is proposed. This loss function combines the advantages of Inner-IoU and GIoU, achieving more stable and efficient bounding box regression through an auxiliary bounding box mechanism and generalized intersection-union ratio calculation.
[0216] Inner-IoU is an IoU calculation method based on auxiliary bounding boxes. Its core idea is to generate auxiliary bounding boxes of different scales using a scaling factor (ratio) to calculate the loss, thus employing different optimization strategies for samples with varying degrees of overlap. For the predicted bounding box B and the ground truth bounding box... The calculation process of the Inner_GIOU loss function is as follows:
[0217] Auxiliary bounding boxes are generated based on the scaling factor ratio to predict the bounding boxes. Coordinates of the four vertices , , , :
[0218] ;
[0219] ;
[0220] in, This indicates the coordinates of the center point of the prediction box. and These represent the width and height of the prediction box, respectively;
[0221] Perform the same operation on the truth box to obtain the auxiliary bounding box of the truth box. Coordinates of the four vertices , , , ;
[0222] Calculate the cross-union ratio (CUI) between the auxiliary bounding boxes of the predicted bounding boxes and the ground truth bounding boxes. :
[0223]
[0224] ;
[0225] ;
[0226] in: and These represent the width and height of the truth box, respectively. This represents the intersection between the auxiliary bounding boxes of the predicted bounding box and the ground truth bounding box. This represents the union of the auxiliary bounding boxes between the predicted bounding boxes and the ground truth bounding boxes.
[0227] GIoU (Generalized IoU) is a generalized version of IoU that solves the problem of zero gradient when the bounding boxes do not overlap, a common issue in traditional IoU. Inner-GIoU introduces a minimum bounding box. The concept and calculation formula are as follows:
[0228] ;
[0229] ;
[0230] ;
[0231] in, This represents the smallest bounding box that encloses the two auxiliary bounding boxes. and express Width and height, express The area of the region after removing the union of the two auxiliary bounding boxes. This represents the generalized intersection-union ratio of the final output;
[0232] Finally, the Inner-GIoU loss function Defined as:
[0233] .
[0234] This loss function has two advantages: firstly, by adjusting the scale of the auxiliary bounding box through the ratio parameter, the network can adaptively adjust the optimization strategy according to the degree of overlap of samples; secondly, the introduction of the GIoU mechanism ensures that effective gradient signals can be generated even when the bounding boxes do not overlap, thus accelerating network convergence.
[0235] The following is a specific example:
[0236] Dataset Description: To achieve accurate detection and location of insulators and their fault types in transmission lines, this example, in collaboration with power grid inspection operations, constructs a comprehensive insulator fault dataset. This dataset was collected using a DJI Mavic 3 drone equipped with a high-resolution camera, capturing images at different distances, angles, and lighting conditions to ensure data diversity and representativeness.
[0237] The complete dataset contains 2,911 high-resolution images covering insulators and related faults in real-world transmission line environments. Each image contains one or more detection targets, and multiple instances of the same or different detection targets may exist within a single image. The images were acquired under diverse conditions, including different time periods (morning, noon, afternoon) and complex backgrounds (forests, mountains, fields, urban areas).
[0238] The target labels in this dataset include three main categories: "normal insulators", "damaged insulators", and "flashover insulators".
[0239] The dataset was labeled using professional annotation software in PASCAL VOC format. Each target in the images was carefully labeled by experienced power system inspection engineers using bounding boxes and corresponding category labels. To ensure annotation quality, all labels underwent expert review. The dataset was randomly divided into training, validation, and test sets in a 7:2:1 ratio, resulting in 2004 training images, 603 validation images, and 304 test images. The sample distribution for each category is shown in Table 1.
[0240] Table 1 Distribution of Insulator Target Data
[0241]
[0242] Evaluation Metrics: To comprehensively evaluate the performance of the proposed detection model, this example employs several widely used metrics in object detection tasks. These metrics provide quantitative assessments of the model's accuracy, recall, and overall detection performance across different categories.
[0243] The evaluation metrics used include:
[0244] Precision (P): Precision measures the proportion of correctly predicted samples out of all samples predicted as positive. It reflects the model's ability to avoid false positives, and is calculated using the following formula:
[0245] ;
[0246] Where TP (True Positives) represents the number of correctly detected targets, and FP (False Positives) represents the number of incorrectly detected targets.
[0247] Recall (R): Recall measures the proportion of correctly predicted instances out of all actual positive instances. It reflects the model's ability to detect all target instances, and is calculated using the following formula:
[0248] ;
[0249] FN (false negatives) represents the number of targets that were not detected.
[0250] Mean Precision (AP): AP is calculated as the area under the precision-recall curve for each class. It provides a single numerical summary of the overall model's performance across all confidence thresholds.
[0251] ;
[0252] Mean Average Precision (mAP): mAP is the average AP value across all target classes, providing an overall measure of the model's detection performance.
[0253] ;
[0254] Where N is the number of target categories.
[0255] Parameters: The total number of trainable parameters in the model, in millions, reflecting the complexity and memory requirements of the model.
[0256] Floating-point operations (GFLOPs): GFLOPs quantizes the computational complexity of a model, expressed in billions of floating-point operations, representing the number of operations required to process a single image.
[0257] In this example, mAP@ is mainly used. 0.5-0.95 (Average accuracy within the IoU threshold range of 0.5 to 0.95) is used as the primary evaluation metric for model comparison because it is widely adopted by the object detection community and can comprehensively evaluate detection accuracy.
[0258] Hardware and Software Configuration: All experiments in this example were conducted on a consistent hardware and software platform to ensure fair comparison. The deep learning framework used for model training and inference was PyTorch 2.2.1. The hardware for model training was an NVIDIA GeForce RTX 3090 graphics card (24GB VRAM), accelerated using CUDA 12.1 and cuDNN 8.5.0. The operating system was Linux, and the Python version used was 3.11. Regarding key training parameters, the batch size was set to 32, the model was trained for 300 epochs, and stochastic gradient descent was used as the optimizer with an initial learning rate of 10. −2
[0259] Data augmentation: To enhance the robustness and generalization ability of the model, various data augmentation techniques were applied during training:
[0260] Mosaic enhancement: Combines four training images into a single mosaic image to increase the diversity of target scale and context.
[0261] Random horizontal flip: Setting the parameter to 0.5 means there is a 50% probability of performing a horizontal flip.
[0262] Random scaling: Setting the parameter to 0.5 means that the image scaling ratio is between 0.5 and 1.5 times (i.e., ±0.5) of the original image.
[0263] HSV Enhancement: This includes enhancement of hue (H), saturation (S), and value (V), controlled by hsv_h, hsv_s, and hsv_v respectively. Setting hsv_h to 0.015 indicates a hue adjustment of 1.5% (range 0-0.015); setting hsv_s to 0.7 indicates a saturation adjustment of 70% (range 0-0.7); and setting hsv_v to 0.4 indicates a value adjustment of 40% (range 0-0.4).
[0264] Translation: The parameter is set to 0.1, which means that the image is translated within a range of ±10% in both the horizontal and vertical directions.
[0265] Rotation: Setting the parameter to 0.0 indicates that rotation enhancement is not performed.
[0266] To verify the effectiveness and superiority of the proposed method, a comprehensive comparative experiment was conducted with various advanced target detection algorithms.
[0267] First, the proposed model was compared with different versions of the YOLO series, which are widely used in real-time object detection applications. The comparison included YOLOv5, YOLOv8, YOLOv10, YOLOv11, and YOLOv11 models. All models were trained on the same dataset using their default configurations and optimized hyperparameters. The experimental results are shown in Table 2, which illustrates the detection performance of different models on the three object categories and the overall mAP.
[0268] Table 2 Detection results of different models
[0269]
[0270] As can be observed from Table 2, the proposed model achieved the highest mAP. 50-95 The accuracy was 0.514%, which is an improvement of 7.4%, 6.4%, 5.3% and 4.6% compared to YOLOv5, YOLOv8, YOLOv10 and YOLOv11, respectively. This demonstrates the effectiveness of the proposed improvement in enhancing the accuracy of insulator fault detection.
[0271] Comparison of different backbone networks: To verify the effectiveness of the proposed AMSB (Adaptive Multi-Scale Backbone Network) module, extensive comparative experiments were conducted with several state-of-the-art lightweight backbone networks. The comparison targets included HGNetV2, MobileViTv2, and ResNet101, networks renowned for their efficiency and performance in mobile and embedded vision applications. Table 3 shows the comparison results of different backbone networks integrated into the same detection framework. All models were trained under the same conditions and hyperparameters to ensure fair comparison.
[0272] Table 3 Performance Comparison of Different Backbone Networks
[0273]
[0274] Experimental results show that the proposed AMSB backbone network achieves a peak mAP of 51.4% in the 0.5-0.95 range, significantly outperforming HGNetV2 (44.8%), MobileViTv2 (47.6%), and ResNet101 (47.2%). This corresponds to improvements of 6.6%, 3.8%, and 4.2%, respectively. AMSB's superior performance is attributed to its attention-enhanced multi-scale feature extraction mechanism, which effectively captures fine-grained damage details and global contextual information in insulator images. AMSB achieves an optimal balance between precision (73.2%) and recall (68.4%). This balanced performance is crucial for practical deployment, ensuring high detection accuracy and comprehensive fault coverage. MobileViTv2 exhibits competitive precision (72.7%), but its low recall (63.0%) indicates a tendency to miss some fault instances. HGNetV2 and ResNet101 exhibited relatively low accuracy rates (71.5% and 70.2%, respectively), indicating a higher number of false positives. The modest increase in computational cost (approximately 15-20% compared to the most efficient alternative) is reasonably justified by the significant accuracy improvement (6-7% improvement in mAP@0.5).
[0275] AMSB's superior performance demonstrates that its attention-enhanced architecture is particularly effective at capturing the subtle and diverse visual features of insulator faults. The multi-scale feature extraction mechanism enables the network to process details at different resolutions simultaneously, which is crucial for detecting both large-scale structural damage and small-scale surface defects such as flashover marks.
[0276] Comparison of different neck architectures: The neck module plays a crucial role in multi-scale feature fusion for object detection. To demonstrate the effectiveness of the proposed HCAFN (Hierarchical Cross-Attention Fusion Neck), comparative experiments were conducted with several state-of-the-art neck architectures, including RepGFPN, BiFPN, and SlimNeck. Table 4 shows the performance comparison of different neck architectures when integrated with the same backbone network and detection head.
[0277] Table 4 Performance Comparison of Different Neck Architectures
[0278]
[0279] The experimental results show that the proposed HCAFN achieves a peak mAP of 51.4% at 0.5–0.95, outperforming RepGFPN (47.2%), BiFPN (47.7%), and SlimNeck (49.8%) by 4.2%, 3.7%, and 1.6%, respectively. This significant improvement validates the effectiveness of the hierarchical cross-attention mechanism in aggregating multi-scale features for insulator fault detection. HCAFN achieves the best balance between precision (73.2%) and recall (68.4%), demonstrating its ability to accurately detect faults while maintaining comprehensive coverage. BiFPN shows the highest precision (74.2%) but the lowest recall (60.4%), indicating a conservative detection strategy that may miss some fault instances. SlimNeck exhibits good recall (65.8%) but low precision (70.0%), indicating a significant number of false positives. RepGFPN shows relatively balanced but overall lower performance (72.3% precision, 60.9% recall). HCAFN requires 9.7 GFLOPs and 3.85M parameters, comparable to RepGFPN (9.6 GFLOPs, 3.69M) and BiFPN (9.8 GFLOPs, 3.28M). While its computational cost is slightly higher than SlimNeck (8.5 GFLOPs, 3.2M), HCAFN achieves a 2.8% higher mAP, demonstrating a superior efficiency-accuracy tradeoff. HCAFN's superior performance can be attributed to its pyramid region context mechanism, which enables adaptive feature fusion across different scales. Unlike traditional FPN-based methods that simply concatenate or add features, HCAFN selectively emphasizes informative features and suppresses redundant information, resulting in more discriminative feature representations.
[0280] Comparison of different IoU loss functions: Bounding box regression loss functions significantly affect detection accuracy and localization quality. To evaluate the effectiveness of the proposed Inner-GIoU loss, comprehensive experiments were conducted, comparing it with several state-of-the-art IoU-based loss functions, including CIoU, GIoU, EIoU, and Inner-IoU. Table 5 shows the performance comparison of different IoU loss functions using the same model architecture.
[0281] Table 5 Performance Comparison of Different Loss Functions
[0282]
[0283] The experimental results show that the proposed Inner-GIoU loss achieves a highest mAP of 51.4% at 0.5–0.95, outperforming CIoU (50.4%), GIoU (50.5%), EIoU (49.4%), and Inner-IoU (50.7%). While the improvements over CIoU and Inner-IoU are relatively limited (1.0% and 0.7%, respectively), the gain over EIoU is more significant (2.0%).
[0284] Inner-GIoU achieves the best balance between precision (73.2%) and recall (68.4%). GIoU shows the highest precision (75.0%) but a lower recall (64.9%), indicating a conservative prediction tendency with fewer false positives but more false negatives. CIoU exhibits a high recall (69.0%) but a relatively low precision (71.1%), indicating a higher number of false positives. Inner-IoU offers competitive performance with 74.1% precision and 67.0% recall.
[0285] The continuous improvement shown by Inner-GIoU across different IoU thresholds (from 0.5 to 0.95) demonstrates that the proposed loss function effectively guides the network to generate more accurate bounding boxes. Its internal mechanism helps the network focus on the core region of the object, reduces sensitivity to background noise, and improves localization accuracy.
[0286] The consistent improvements achieved by Inner-GIoU across all evaluation metrics validate its effectiveness in insulator fault detection. The enhanced location quality is particularly valuable for automated detection systems, as accurate bounding boxes enable better fault characterization and more reliable defect severity assessment.
[0287] Extensive ablation experiments were conducted to comprehensively evaluate the contribution of each proposed component. The baseline model was YOLOv8n, and the impact of each component, both individually and in combination, on detection performance was analyzed by progressively adding components. Table 7 presents detailed ablation study results, showing the incremental improvements brought about by adding each proposed component.
[0288] Ablation studies have revealed several key findings:
[0289] Baseline performance: The original YOLOv8n model achieved 45.0% mAP@50-95 on this insulator fault dataset, serving as the baseline for comparison. While this performance is acceptable, there is still significant room for improvement, particularly in detecting broken and flashover insulators.
[0290] Single component effect:
[0291] CSP_MSCAF (Module A): When this component is added to the baseline alone, mAP@0.5:0.95 is improved to 46.8%, an increase of 1.8%. This improvement is mainly attributed to its adaptive multi-scale feature extraction and channel adaptive fusion mechanism. Through parallel depthwise separable convolutional branches of three different scales (3×3, 5×5, and 7×7), CSP_MSCAF can simultaneously capture...
[0292] Table 6 Ablation Experiment Results
[0293] It acquires local fine-grained details and large-scale contextual information, and adaptively learns the relative importance of features at different scales through a channel attention mechanism.
[0294] SPPF_LSKA (Module B): Merging only this component yields 47.1% mAP@0.5:0.95, a 2.1% improvement over the baseline. This component primarily addresses the issue of insufficient global context understanding in insulator detection. Insulator strings have a hierarchical structure, requiring both the identification of detailed features of individual insulator discs and an understanding of the overall structural context of the complete insulator string, especially given the extreme scale variations that occur at different observation distances. SPPF_LSKA achieves a dual receptive field expansion by combining multi-scale feature extraction using spatial pyramid pooling with long-range dependency modeling using Large Separable Kernel Attention (LSKA).
[0295] HCAFN (Module C): Adding this component alone achieves a 48.4% mAP@0.5:0.95 improvement, a 3.4% increase, making it the most significant improvement among all single components. This enhancement is particularly evident in multi-scale feature fusion quality and small target detection capabilities, demonstrating the component's effectiveness in eliminating feature interference and enhancing cross-scale information integration. HCAFN achieves superior performance through three cooperating sub-modules: the Pyramid Region Context Module (PRCM) captures spatial dependencies and directional context through region-aware attention; the Gated Feature Fusion Module (GFFM) employs an adaptive gating mechanism to selectively combine features from different levels, effectively suppressing noise and irrelevant information; and the Cross-Scale Interpolation Fusion Module (CSIF) preserves high-frequency details during scale transformations through learnable residual connections. HCAFN can accurately distinguish normal insulators from background interference in complex backgrounds while maintaining good detection performance for distant small-scale targets.
[0296] Inner_GIoU (Module D): Adding this component alone achieves 46.2% mAP@0.5:0.95, an improvement of 1.2%. This enhancement is particularly noticeable in terms of bounding box localization accuracy and training convergence stability, demonstrating the effectiveness of this component in addressing IoU gradient fluctuations and accelerating model optimization. Inner_GIoU achieves two improvements by introducing an auxiliary bounding box mechanism (ratio parameter) and generalized IoU calculation: (1) Through the adjustable ratio parameter, the network can adaptively adjust the optimization strategy according to the degree of sample overlap, using different regression strengths for highly overlapping and low-overlapping samples; (2) Inheriting the advantages of GIoU, it ensures that effective gradient signals can be generated even when the bounding boxes do not overlap. This component significantly enhances the ability to identify damaged insulators because damaged areas often have irregular shapes and blurred boundaries. Inner_GIoU's adaptive regression mechanism can more accurately fit these complex bounding boxes, reducing detection instability caused by pixel-level errors.
[0297] Combination effect:
[0298] The A+B combination, when integrating both CSP_MSCAF and SPPF_LSKA, achieves an mAP@0.5:0.95 of 48.5%, a 3.5% improvement. This combination demonstrates the synergistic effect between multi-scale feature extraction and global context modeling in the backbone network. The rich multi-scale features provided by CSP_MSCAF offer more discriminative input to the large receptive field attention mechanism of SPPF_LSKA, making global context modeling more effective. This combination performs best in flashover insulator detection because multi-scale features can capture flashover traces of different granularities, while large-kernel attention can correlate these dispersed flashover patterns. The synergistic effect of both significantly improves the ability to identify subtle surface changes.
[0299] The A+B+C combination, after adding HCAFN to the A+B model, achieves a mAP@0.5:0.95 of 50.4%, an improvement of 5.4%, representing the largest incremental gain (an additional +1.9%). HCAFN's hierarchical fusion mechanism fully utilizes the features enhanced by the first two modules: it further refines spatial context information through the Pyramid Region Context Module (PRCM), selectively combines multi-scale and context-rich features from different levels through the Gated Feature Fusion Module (GFFM), and preserves key spatial details during feature aggregation through the Cross-Scale Interpolation Fusion Module (CSIF). Because HCAFN's gating mechanism effectively suppresses interference from complex backgrounds while emphasizing the structural features of insulators, the model can accurately identify normal insulators even against complex backgrounds such as vegetation, sky, and power lines.
[0300] Complete Model A+B+C+D: When all proposed components are integrated, the complete model achieves 51.4% mAP@0.5:0.95, a 6.4% improvement over the baseline. The addition of Inner_GIoU contributes an additional 1.0% improvement. The auxiliary bounding box mechanism of Inner_GIoU works perfectly with the multi-scale features of CSP_MSCAF to provide an adaptive regression strategy for targets of different sizes; its generalized IoU calculation works in conjunction with the context-enhanced features of SPPF_LSKA to provide effective gradients even in low-overlap situations; its focus on the core region of the object, combined with the fine-grained fusion features of HCAFN, achieves accurate boundary fitting for irregularly shaped targets.
[0301] The above are preferred embodiments of the present invention. Any changes made to the technical solution of the present invention that do not exceed the scope of the technical solution of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for detecting insulator defects based on a hierarchical multi-scale adaptive fusion network, characterized in that, The steps are as follows: Step 1: Collect a dataset of images of insulators in the transmission line using drone equipment, and label the insulator categories, including normal insulators, damaged insulators, and flashover insulators; Step 2: Build the HMSAF-YOLO model, which consists of three parts: the backbone network, the neck network, and the detector. In the backbone network, a cross-stage partial multi-scale channel adaptive fusion CSP_MSCAF module and a fast spatial pyramid pooling SPPF_LSKA module with large kernel separation and attention are introduced to perform multi-scale feature extraction and feature enhancement. In the neck network, the pyramid region context module PRCM, the gated feature fusion module GFFM, and the cross-scale interpolation fusion module CSIF are combined to perform feature fusion. Step 3: Train the HMSAF-YOLO model using the preprocessed insulator image dataset; Step 4: Use the final detection model to detect insulator defects in the image to be tested and output the prediction results.
2. The insulator defect detection method based on a hierarchical multi-scale adaptive fusion network according to claim 1, characterized in that, The network architecture of the backbone network and the neck network is as follows: The backbone network comprises 5 Conv units, 4 CSP_MSCAF modules, and 1 SPPF_LSKA module. The input image sequentially passes through the first Conv unit, the second Conv unit, the first CSP_MSCAF module, the third Conv unit, the second CSP_MSCAF module, the fourth Conv unit, the third CSP_MSCAF module, the fifth Conv unit, the fourth CSP_MSCAF module, and the SPPF_LSKA module to obtain enhanced multi-scale features. Each Conv unit sequentially includes a two-dimensional convolutional layer, a batch normalization layer, and a Silu activation function. The neck network comprises one PRCM module, three GFFM modules, two CSIF modules, three C2F modules, and two Conv units. Specifically: the output feature P3 of the second CSP_MSCAF module of the backbone network is input to both the second CSIF module and the PRCM module; the output feature P4 of the third CSP_MSCAF module of the backbone network is input to both the first CSIF module and the PRCM module; the output feature P5 of the SPPF_LSKA module of the backbone network is input to both the first GFFM module and the PRCM module; and the multi-scale features P3', P4', and P5' output by the PRCM module are input to the third GFFM module, the second GFFM module, and the first GFFM module, respectively. The output features of the first GFFM module are input into the first CSIF module. The output features of the first CSIF module are input into the second GFFM module. The output features of the second GFFM module are input into the second CSIF module. The output features of the second CSIF module are input into the third GFFM module. The output features of the third GFFM module are sequentially processed through the first C2F module and the sixth Conv unit, and then concatenated with the output features of the second GFFM module. The resulting first concatenated feature is sequentially processed through the second C2F module and the seventh Conv unit, and then concatenated with the output features of the first GFFM module. The resulting second concatenated feature is input into the third C2F module. The output features of the three C2F modules are respectively input into three detection heads for defect detection.
3. The insulator defect detection method based on a hierarchical multi-scale adaptive fusion network according to claim 2, characterized in that, The specific processing procedure of the CSP_MSCAF module is as follows: The CSP_MSCAF module takes input features and passes them through a 1×1 convolutional unit. Then, it uses a Split operation to split the features along the channel dimension, resulting in two parts. ;feature Each output feature and feature obtained after stacking n MSCAF modules After concatenation, the output features of the CSP_MSCAF module are obtained through a 1×1 convolutional unit. Specifically, it is expressed as: ; in, Represents a 1×1 convolutional unit. Indicates splicing, This represents the output feature of the nth MSCAF module. This represents the nth MSCAF module.
4. The insulator defect detection method based on a hierarchical multi-scale adaptive fusion network according to claim 3, characterized in that, The specific processing procedure of the MSCAF module is as follows: MSCAF module input features Features are obtained through a 1×1 convolutional unit. Then it enters three parallel branches, three Separable convolutions with kernel sizes of 3×3, 5×5, and 7×7 were used to capture information at specific scales: ; ; ; in, , and The kernel size is represented as , , Depth convolution; Input features The concatenated features are then concatenated with the output features of all three branches, and a 1×1 convolutional unit is used to compress the concatenated features to the desired output channel dimension. The resulting features are then... Channel-level statistics are calculated using global average pooling and global max pooling: ; in, and These represent global average pooling and global max pooling, respectively. and All are fully connected layers with 1×1 convolutions. It is a ReLU activation function. It is the sigmoid activation function. This represents element-wise multiplication. For attention weights, The feature output is weighted for attention; Introducing learnable parameters and Normalization is achieved through the softmax operation. and : ; Final output of the MSCAF module Form a residual connection with the original input: 。 5. The insulator defect detection method based on a hierarchical multi-scale adaptive fusion network according to claim 2, characterized in that, The SPPF_LSKA module integrates the LSKA module into the fast spatial pyramid pooling SPPF network. The multi-scale features input to the SPPF_LSKA module are sequentially passed through one Conv unit and three MaxPool2d layers, and the four output features are concatenated. The concatenated features are then sequentially passed through one LSKA module and one Conv unit to finally obtain the enhanced multi-scale features.
6. The insulator defect detection method based on a hierarchical multi-scale adaptive fusion network according to claim 5, characterized in that, The specific processing procedure of the LSKA module is as follows: The input features F of the LSKA module are sequentially processed through two cascaded convolutional units and one 1×1 convolutional unit, and then the output features of the LSKA module are obtained through an attention mechanism. : in: , These represent the output features of the two cascaded convolutions, , Let k and d represent 1D convolutions in the horizontal and vertical directions, respectively, where k is the kernel size and d is the dilation rate. Indicates rounding down. ⊙ represents a 1×1 convolutional unit, and ⊙ represents element-wise multiplication.
7. The insulator defect detection method based on a hierarchical multi-scale adaptive fusion network according to claim 2, characterized in that, The processing procedure of the PRCM module is as follows: Transform operations are performed on the three input features P3, P4, and P5 at different scales to align the feature dimensions. For the shallow feature P3, a two-stage transformation is applied to obtain the feature. : ; For the intermediate-scale feature P4, features are obtained through a 1×1 convolutional unit. : ; After performing spatial upsampling on the deep features P5, the features are obtained through a 1×1 convolutional unit. : ; in: Indicates bilinear upsampling. , These represent 1×1 convolutional units and 3×3 convolutional units, respectively. The aligned features are then concatenated along the channel dimension to form a unified hybrid feature. : The RCA module is introduced to model directional context features using parallel horizontal and vertical pooling operations. : in, This indicates adaptive average pooling in the horizontal direction. This indicates adaptive average pooling in the vertical direction; Spatial attention is computed through a series of grouped convolutions with striped kernels. First, group them. convolution Reduce channels to obtain features And apply batch normalization Features obtained with ReLU activation Then through grouping convolution Recovery Channel Acquisition Features Spatial attention is ultimately obtained by performing sigmoid activation. Attention computation follows a bottleneck structure with striped convolutions: in: Represents the size of the band-shaped nucleus. Represents the sigmoid function; Parallel to the attention path, through The deep convolutional layer extracts local features; the final output combines local features and global context through an attention mechanism to enhance the features. : ; Enhanced features will be achieved through channel separation. Reverting to their original scale representations P3', P4', and P5': 。 8. The insulator defect detection method based on a hierarchical multi-scale adaptive fusion network according to claim 2, characterized in that, The processing procedure of the GFFM module is as follows: The input low-level features contain fine-grained spatial details and high-level features of encoded semantic information Intermediate representations are generated by performing convolutional transformations. , : ; ; Among them, the output features P3 of the second CSP_MSCAF module, P4 of the third CSP_MSCAF module, and P5 of the SPPF_LSKA module are low-level features containing fine-grained spatial details, while the output features P3', P4', and P5' of the PRCM module are high-level features encoding semantic information. This represents a 1×1 convolutional unit without an activation function; The final fused features are obtained by combining the transformed low-level features with the gated high-level features. Element-wise multiplication yields: in: Represents the hard-Sigmoid function. This represents the ReLU6 activation function.
9. The insulator defect detection method based on a hierarchical multi-scale adaptive fusion network according to claim 2, characterized in that, The specific processing procedure of the CSIF module is as follows: For low-resolution features of the input and high-resolution features , , ,in, These represent the number of channels and spatial dimension of the high-resolution feature, respectively. These represent the number of channels and spatial dimension of the low-resolution feature, respectively, with scale i having a higher resolution than scale j; Low-resolution features Features are obtained through bilinear interpolation. To match the spatial dimensions of high-resolution features: ; in This represents the bilinear interpolation operation; After spatial alignment, features Learnable channel transformation is performed using 1×1 convolutional units and combined with high-resolution features. Perform additive fusion to obtain the output features of the CSIF module : 。 10. The insulator defect detection method based on a hierarchical multi-scale adaptive fusion network according to claim 1, characterized in that, The model training uses the Inner_GIOU loss function to achieve adaptive optimization for samples with different degrees of overlap. The calculation process of the Inner_GIOU loss function is as follows: Auxiliary bounding boxes are generated based on the scaling factor ratio to predict the bounding boxes. Coordinates of the four vertices , , , : ; ; in, This indicates the coordinates of the center point of the prediction box. and These represent the width and height of the prediction box, respectively; Perform the same operation on the truth box to obtain the auxiliary bounding box of the truth box. Coordinates of the four vertices , , , ; Calculate the intersection over union between the predicted bounding box and the auxiliary bounding box of the ground truth bounding box : ; ; in: and These represent the width and height of the truth box, respectively. This represents the intersection between the auxiliary bounding boxes of the predicted bounding box and the ground truth bounding box. This represents the union of the auxiliary bounding boxes between the predicted bounding box and the ground truth bounding box; Inner-GIoU introduces a minimum bounding box. The concept and calculation formula are as follows: ; ; ; in, This represents the smallest bounding box that encloses the two auxiliary bounding boxes. and express Width and height, express The area of the region after removing the union of the two auxiliary bounding boxes. This represents the generalized intersection-union ratio of the final output; Finally, the Inner-GIoU loss function Defined as: 。
Citation Information
Cited By
Chemical experiment device identification method, device and equipment based on multilayer feature fusion
CN121904723A
Method and device for detecting target visual element in image and medium
CN122023780A
Satellite target detection method and system based on multi-scale feature fusion enhancement
CN122336588A