Power transmission line defect detection method and system based on selective direction perception
By introducing a selective direction-aware architecture into the RT-DETR model, the problems of weakened small target features, missing direction information, and insufficient detail discrimination in power transmission line detection are solved. This enables high-precision and robust power transmission line defect detection, adapts to complex backgrounds and occluded environments, and meets the real-time requirements of UAV inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI UNIVERSITY OF ELECTRIC POWER
- Filing Date
- 2026-04-02
- Publication Date
- 2026-05-15
AI Technical Summary
Existing target detection algorithms suffer from problems such as weakened small target features, lack of directional geometric information, insufficient detail discrimination, and insensitivity to loss functions in power transmission line defect detection, resulting in detection robustness and accuracy that are difficult to meet practical needs.
Based on the RT-DETR model, a selective orientation-aware detection architecture is introduced. This is achieved by adding a selective enhancement module to the backbone network, introducing orientation-aware convolutional kernels in the feature fusion stage, integrating a local recalibration mechanism in the Transformer encoder, and designing a loss function that fuses angle constraints and sample adaptation to optimize localization accuracy.
It achieves high-precision detection of slender, small-scale, and directional defects in power transmission line scenarios, improving the reliability and efficiency of UAV intelligent inspection, adapting to complex backgrounds and obstructed environments, and maintaining high-efficiency inference speed.
Smart Images

Figure CN122048864A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of transmission line conductor inspection technology, and in particular to a method and system for detecting transmission line defects based on selective direction sensing. Background Technology
[0002] While UAV intelligent inspection and target detection technologies have made continuous progress, they still face numerous challenges in practical applications for power transmission line defect detection. Power transmission lines, as a critical component of the power system, are vital for their safe and stable operation. Insulators, towers, and other transmission line components are exposed to complex natural environments for extended periods, making them susceptible to damage, contamination, and external interference. These abnormalities are often significant sources of power grid failures. UAV inspection, with its efficiency and flexibility, has become the mainstream method for monitoring the condition of power transmission lines. In actual inspections, UAVs need to perform high-precision detection tasks in complex and ever-changing natural environments, and their effectiveness depends on the accurate identification and localization of targets in the inspection images. However, this scenario generally presents challenges such as large target scale variations, prominent geometric features, and complex backgrounds, posing significant challenges to defect detection. Although existing target detection algorithms perform well in general vision tasks, they still have significant limitations in the specific application scenario of power transmission lines.
[0003] In the field of object detection, two relatively clear and distinct technological development paths have emerged: one is object detection frameworks based on convolutional neural networks (CNNs), and the other is the rapidly rising and widely used Transformer-based detection frameworks. CNN-based object detection methods rely on convolutional kernels for feature extraction and achieve object localization and recognition through mechanisms such as region proposal, feature pyramid construction, and classification regression, dominating early object detection tasks for a long time. Typical two-stage methods, such as Faster R-CNN, achieve high accuracy through region proposal (RPN) mechanisms, but their inference speed is relatively slow; while one-stage methods such as YOLO and SSD directly predict the bounding box and class label of the object, significantly improving inference efficiency through an end-to-end prediction architecture. However, due to their local convolutional characteristics, CNNs struggle to capture long-distance structural relationships and have limited capabilities when processing targets with overall structural features, such as being prone to missed detections and false detections in occluded scenes. Furthermore, these methods generally rely on pre-set anchor boxes and complex non-maximum suppression (NMS) processes, which easily introduce inductive bias and increase computational redundancy.
[0004] With the success of the Transformer architecture in natural language processing, its potential in computer vision tasks is gradually being explored. The DETR series of models, based on self-attention mechanisms, effectively overcomes the limitations of the local receptive field in convolutional neural networks by modeling global dependencies. However, early DETR models suffered from slow convergence and insufficient sensitivity to small targets. Subsequent improved models, such as Deformable DETR, improved training efficiency and small target detection performance by introducing multi-scale features and sparse attention mechanisms, but still have limitations in modeling long-distance dependencies and complex scale variations. The DN-DETR model accelerates the convergence process using a noisy query denoising mechanism, but still needs improvement in feature discrimination and robustness in complex backgrounds. In contrast, the RT-DETR model, by introducing an efficient hybrid encoder and an uncertainty-minimizing query selection mechanism, significantly improves inference speed while maintaining high accuracy, and completely eliminates the latency and hyperparameter sensitivity problems caused by traditional NMS post-processing, providing a new approach for real-time high-precision object detection.
[0005] While Transformer-based end-to-end detection algorithms offer significant advantages in simplifying processes and global modeling, they still have shortcomings in transmission line defect detection scenarios. The main issue lies in the fact that existing models fail to adequately adapt to the characteristics of transmission line scenarios—small, elongated targets, and complex backgrounds—leading to deficiencies in key detection stages. Existing methods lack sufficient capture of detailed information about minute defects during feature extraction and lack the ability to explicitly model the directional geometric features of targets such as conductors and insulator strings during multi-scale fusion. Furthermore, their global attention mechanism tends to over-smooth high-frequency details, and the general bounding box regression loss struggles to accurately characterize the shape and angle of elongated targets, limiting localization accuracy. These structural deficiencies make it difficult for models to meet practical engineering requirements in transmission line scenarios with complex backgrounds and densely packed small targets, resulting in insufficient robustness and accuracy.
[0006] To address the challenges of small, highly directional, and complex background defects encountered during power transmission line inspections, this invention proposes an improved selective direction-aware DETR detection architecture. This architecture enhances the modeling ability for the geometric structures of slender targets and the discriminative power of local features by introducing a direction-adaptive feature fusion module and a detail enhancement mechanism. Specifically, the model embeds a selective enhancement module into the backbone network to improve the feature representation of small targets; employs multi-directional convolutional kernels in the feature pyramid network to explicitly extract spatial geometric priors; and integrates a local recalibration mechanism into the Transformer encoder to recover detailed information. Furthermore, by designing a loss function that integrates angle constraints and adaptive sample difficulty, the localization accuracy for direction-sensitive targets is further improved.
[0007] The invention disclosed in CN116843649A presents an intelligent defect detection method for power transmission lines based on an improved YOLOv5 network, comprising the following steps: improving the YOLOv5 network to construct a target detection network, which includes a backbone network, a path fusion network, and an output module; training the target detection network using a power transmission line database; and saving the trained target detection network; inputting the image of the power transmission line to be detected into the trained target detection network and outputting the corresponding target detection result. This invention's detection method solves the problem of high industrial data collection costs by proposing a data augmentation algorithm, significantly reducing the false negative and false positive rates. The addition of a ghost convolution module improves the cross-stage local network of YOLOv5, effectively increasing the network prediction speed. The addition of an attention mechanism to the backbone network enhances the accuracy of defect detection and the ability to detect "small targets" in complex power transmission scenarios. However, this scheme has weak detection accuracy for small target defects in power transmission scenarios and poor adaptability.
[0008] In summary, existing advanced target detection algorithms have many limitations in the application of power transmission line defect detection, mainly reflected in the weakening of small target features, lack of directional geometric information, insufficient discriminative ability in detail, and insensitivity to loss functions. CNN-based methods are limited by their local modeling capabilities, making it difficult to capture long-distance structural relationships and prone to missing slender, small targets. While the Transformer-based DETR model has the advantage of global modeling, it suffers from high computational cost and insufficient robustness in directional feature modeling and complex backgrounds. To address these issues, this invention proposes a highly efficient detection algorithm framework integrating selective enhancement, directional awareness, and discriminative recovery mechanisms, aiming to achieve more accurate and robust defect detection for intelligent inspection of power transmission lines. Summary of the Invention
[0009] This invention addresses the common problems in power transmission line inspection images, such as small target size, elongated shape, significant directionality, and complex backgrounds. Based on the overall structure of RT-DETR, it proposes a selective direction-aware method for power transmission line defect detection. Improvements are made at four levels: feature extraction, fusion, enhancement, and regression. A selective enhancement module is added to the backbone network to enhance the feature representation of small targets; a direction-aware convolutional kernel is introduced in the feature fusion stage to model the geometric structure; a local recalibration mechanism is integrated into the Transformer encoder to recover detailed information; and a loss function combining fusion angle constraints and sample adaptation is designed to optimize positioning accuracy. This invention aims to achieve high-precision detection of defects in power transmission line scenarios, improve the reliability and efficiency of UAV intelligent inspection, and is expected to overcome the accuracy and robustness bottlenecks of existing detection models in identifying small target defects in power transmission lines.
[0010] The objective of this invention can be achieved through the following technical solutions: A method for detecting transmission line defects based on selective direction sensing, the method comprising the following steps: Step 1: Acquire images of power transmission line inspections and extract features to obtain a preliminary feature map; perform feature enhancement processing on the preliminary feature map: group the features by channel dimension and extract structure-aware features and detail texture features respectively, while retaining some original features; fuse the features of each group, perform channel-weighted enhancement on the fused features, and then fuse them with the preliminary feature map to obtain an enhanced feature map; Step 2: The enhanced feature map is serialized and positional encoding is added to obtain a positional encoding feature sequence. Global attention is then calculated on the positional encoding feature sequence to obtain global association features. First-level local recalibration is performed on the global association features to supplement lost local details in the global calculation, resulting in primary restored features. These primary restored features are then enhanced using a feedforward network to obtain enhanced features. Second-level local recalibration is performed on the enhanced features to further improve the discriminative power of local details, resulting in encoded features. Step 3: Extract multi-directional geometric features from the encoded features in parallel using multi-morphological convolutional kernels, and concatenate all directional features along the channel dimension to form a comprehensive directional awareness feature; perform weighted fusion of the preliminary feature map, enhanced feature map, and comprehensive directional awareness feature, and optimize the alignment of the fused feature using soft nearest neighbor interpolation; simultaneously, downsample and reorganize the shallow features in the fused feature to obtain detail enhancement features, and concatenate them with the aligned and optimized features to obtain the final fused feature.
[0011] Furthermore, the feature enhancement process specifically includes: The features are grouped along the channel dimension, and structure-aware features and detail texture features are extracted separately, while retaining some of the original features, resulting in: in, This is a structurally perceptible feature. For detailed texture features, To preserve some of the original features; C represents the total number of channels, H represents the feature map height, and W represents the feature map width; First, the structure-aware features and detail texture features are interacted and fused across channels, and then integrated with the retained original features to obtain the fused features: in, The characteristics after fusion This indicates a channel mixing operation. Represents the projected features. , Here are the projection layer parameters, and σ(·) is the activation function. It is a 3×3 convolution. Features after splicing This indicates the SCConv operation, and Shuffle(·) is the channel shuffling operation.
[0012] Furthermore, the fused features are enhanced using a channel-weighted attention mechanism, specifically including: First, global average pooling is used to obtain the global statistical description of each channel. Then, one-dimensional convolution is used to establish local cross-channel dependencies and generate adaptive channel attention weights. Finally, the fused features are weighted channel by channel using the Sigmoid function to enhance the features of key channels, and the output is... Then The enhanced feature map is obtained by fusing it with the retained original features, and is represented as follows: in, The features are obtained by weighting each channel. To preserve some of the original features.
[0013] Furthermore, the enhanced feature map is flattened into a one-dimensional sequence and positional encoding is added, followed by global attention calculation to obtain global association features. The global association features are then subjected to a first-level local recalibration to obtain primary recovery features. The calculation formula for the primary recovery features is as follows: Where x is the input feature tensor, LN(·) denotes layer normalization, and s1 and s2 are learnable weights; , These are dimensionality reduction and dimensionality expansion projections, respectively. and These are residual structures with multi-scale depthwise convolution and pointwise convolution, respectively. Nonlinear activation; This is a primary recovery characteristic. Representation layer normalization, This indicates a shape rearrangement operation. The flattened feature sequence, For position encoding.
[0014] Furthermore, the primary recovered features are enhanced using a feedforward network to obtain enhanced features; the enhanced features are then subjected to a second-level local recalibration to obtain encoded features, the calculation formula for which is: in, This indicates a feedforward fully connected network. These are encoding features.
[0015] Furthermore, the multi-directional geometric features specifically include vertical structure perception features, horizontal structure perception features, overall geometric perception features, and local texture features; these multi-directional geometric features are concatenated along the channel dimension to form a comprehensive direction perception feature, the concatenation expression being: in, The characteristics of the i-th directional branch are represented. This indicates that the size used is k. h ×k w Depthwise separable convolutions are used to extract orientation-aware features from input features X, where X represents the input features. Represents the perceived features of vertical structure. This represents the perceptual features of lateral structure. Represents overall geometric perception features. Represents local texture features. This represents the feature fusion layer.
[0016] Furthermore, by introducing learnable adaptive fusion weights, the comprehensive direction-aware features are weighted and fused with the preliminary feature map and the enhanced feature map to obtain the fused features. The fusion expression is as follows: in, Features after fusion For learnable adaptive weight coefficients, These are the normalized weight values. These are the learnable raw weight parameters. This is the output of the i-th feature branch.
[0017] Furthermore, the fused features are aligned and optimized using a soft nearest neighbor interpolation method, with the alignment expression being: Where Y represents the upsampled high-level feature map. This is a soft factor in soft nearest neighbor interpolation (SNI), used to dynamically adjust the weights of high-level semantic features. The input is a high-level semantic feature map. This indicates the nearest neighbor interpolation operation. ) represents the spatial resolution of the input feature map X. This represents the spatial resolution of the output feature map Y.
[0018] Furthermore, the final fused features are fed into a pre-built prediction model to obtain the defect identification result. The prediction model is trained using a pre-built fusion sample focusing mechanism and a loss function with directional geometric constraints. The loss function is obtained by weighted fusion of a pre-built direction-sensitive loss function, a classification loss function, and an auxiliary loss function. The specific expression of the loss function is as follows: in, The intersection-over-union ratio (IoU) represents the ratio of the predicted bounding box to the ground truth bounding box; d represents the lower bounding threshold of the linear mapping interval; and u represents the upper bounding threshold of the linear mapping interval. This represents the SIoU loss function, where Δ is the angular constraint distance loss and Ω is the shape loss. For direction-sensitive loss function, For classification loss function, As an auxiliary loss function, These are the weighting coefficients for the three loss terms. This is the Focaler-IoU value after linear mapping reconstruction.
[0019] The present invention also provides a detection system for a transmission line defect detection method based on selective direction sensing, comprising a memory and a processor, wherein the memory stores a computer program, and the processor calls the computer program to execute the steps of any of the methods described above.
[0020] Compared with the prior art, the present invention has the following advantages: (1) This invention systematically improves the traditional RT-DETR model and constructs a task-adaptive Transformer detection framework: a selective enhancement module is embedded in the backbone network to improve the fidelity of small target features; an orientation adaptation mechanism is introduced in the feature fusion stage to explicitly model the geometric structure; and a local recalibration module is fused in the encoder to restore the details and textures lost in global attention: a first-level recalibration is performed after the attention layer and a second-level recalibration is performed after the feedforward network, which further enhances the discriminativeness of the features and ensures that the output encoded features retain sufficient local details for accurate defect identification on the basis of rich semantics, and the final output features are more accurate. It combines global semantics with local details, providing a better feature representation for accurate detection; By using multi-morphological convolutional kernels to extract multi-directional geometric features from images, we extract vertical structure perception features, horizontal structure perception features, overall geometric perception features, and local texture features respectively. We consider both the global and local nature of the features and combine them with adaptive weights for multi-source fusion, which enhances the model's understanding of the structure of slender targets. Furthermore, by designing a direction-sensitive regression loss function, we optimize the localization accuracy for long and narrow targets, and achieve high-precision detection of slender, small-scale, and directionally significant defects in power transmission line scenarios.
[0021] (2) This invention constructs a closed-loop detection process of “feature enhancement, detail restoration, orientation perception and regression optimization”, which organically unifies orientation information modeling and multi-scale feature fusion, significantly improving the detection stability and robustness of the model in challenging inspection environments such as backlight, occlusion, long distance and complex background. At the same time, it maintains efficient inference speed within the real-time detection framework of RT-DETR, meeting the strict requirements of UAV platform for real-time processing and engineering deployment.
[0022] (3) The selective direction perception detection method proposed in this invention can be widely applied to the identification of various typical targets such as insulator defects, hardware anomalies, and bird nests in power transmission line inspection. It has strong scene adaptability and task generalization ability, providing reliable technical support for the intelligent upgrading of the power inspection field, and providing a reference improvement framework for similar industrial visual inspection tasks with directional structural features. Attached Figure Description
[0023] Figure 1 This is a flowchart of a transmission line defect detection method based on selective direction sensing provided in an embodiment of the present invention; Figure 2 This is an algorithm framework diagram of a transmission line defect detection method based on selective direction sensing provided in an embodiment of the present invention; Figure 3This is a diagram of the ADOM algorithm framework for a transmission line defect detection method based on selective direction perception, provided in an embodiment of the present invention. Figure 4 This is a flowchart of a transmission line defect detection algorithm provided in an embodiment of the present invention, which describes a transmission line defect detection method based on selective direction sensing. Figure 5 This is a technical roadmap for a transmission line defect detection algorithm based on selective direction sensing, provided in an embodiment of the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0025] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0026] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0027] Definitions: RT-DETR is a real-time object detection model based on the Transformer architecture. By optimizing the encoder-decoder structure and introducing a high-efficiency hybrid encoder, it significantly improves inference speed while maintaining the end-to-end detection advantages of the DETR series, making it suitable for industrial scenarios with high real-time requirements, such as drone inspection and video surveillance.
[0028] ResNet18: ResNet18 is a lightweight version of a deep residual network, containing 18 layers. Its core innovation lies in the introduction of a residual connection structure, which alleviates the vanishing gradient problem in deep networks through identity mapping, enabling the model to be trained more effectively. ResNet18 achieves a good balance between computational efficiency and feature representation capability, and is often used as a backbone network for feature extraction in computer vision tasks.
[0029] SEMB (Selective Enhancement Mixture Block) is a structural module used to enhance the feature representation capabilities of a backbone network. This module groups and differentiates input feature channels, extracts structure-aware features and detailed texture features in parallel, retains some original features, and finally performs channel recalibration through an attention mechanism, thereby strengthening the model's ability to preserve and enhance small targets and detailed features.
[0030] SCConv is a lightweight convolutional module designed to simultaneously reduce spatial and channel redundancy in features. It compresses and reconstructs features through separate spatial and channel reconstruction units, thereby enhancing feature representativeness while reducing computational cost. It is commonly used to improve model efficiency and feature quality.
[0031] ECA attention mechanism: a lightweight channel attention module. It establishes cross-channel interactions by replacing fully connected layers with one-dimensional convolutions, capturing local cross-channel dependencies without dimensionality reduction. This allows for adaptive calibration of channel feature weights with extremely low computational overhead, enhancing the model's ability to focus on key channels.
[0032] AIFI-Mona is a local recalibration module integrated into the Transformer encoder, designed to mitigate the smoothing effect of the global self-attention mechanism on local fine-grained features. This module effectively supplements and enhances the detailed information lost during long-range dependency modeling by performing multi-stage local feature recovery and enhancement after the multi-head self-attention layer and the feedforward network layer, thereby improving the model's ability to detect minor defects.
[0033] DACFM is an improved architecture for multi-scale feature fusion. This module extracts geometric features from different directions in parallel using multi-morphological convolutional kernels and combines them with an adaptive weighted fusion mechanism to explicitly model the orientation information of the target, thereby enhancing the model's ability to represent the features of slender, directional targets in transmission lines.
[0034] FPN / PAN is a classic multi-scale feature fusion structure. FPN transmits semantic information through top-down upsampling, constructing a multi-scale feature pyramid; PAN adds a bottom-up path to FPN, further enhancing the transmission of localization information. The combination of the two can effectively fuse high-level semantics with shallow details, improving the model's detection performance for targets at different scales.
[0035] The ADOM module is the core functional unit in the directional adaptive feature fusion method. This module integrates multi-directional feature extraction, cross-channel interaction, and adaptive weight fusion mechanisms. It can dynamically adjust the feature fusion strategy according to the geometric characteristics of the target, thereby optimizing the feature representation of features with significant directional structures.
[0036] GSConvE Module: The GSConvE module is an efficient and lightweight convolutional module, typically used in feature downsampling paths. It introduces grouping and channel recombination mechanisms on top of standard convolution, maintaining or even enhancing feature representation capabilities while reducing computational parameters. It is suitable for scenarios requiring efficient feature extraction with limited computational resources.
[0037] SPDConv is a feature downsampling method for preserving shallow details. This operation achieves downsampling by reorganizing spatial dimensional information into channel dimensions, avoiding the loss of fine-grained information caused by pooling or strided convolution. This allows for better preservation of edge and texture details while reducing resolution, which is beneficial for small object detection.
[0038] Focaler-IoU is a bounding box regression loss function optimized for difficult samples. It dynamically adjusts the gradient weights of samples in different IoU intervals through a linear interval mapping mechanism, allowing the model to focus more on samples that are difficult to detect accurately (such as low IoU samples) during training, thereby improving the model's robustness in locating difficult targets in complex scenes.
[0039] SioU is an angle-aware bounding box regression loss function. In addition to considering the overlapping area of the bounding boxes, the distance between the center points, and the aspect ratio, SioU explicitly adds a directional constraint, penalizing the directional deviation between the predicted box and the ground truth box through an angle loss term. It is particularly suitable for the accurate localization of slender targets that are sensitive to orientation (such as insulator strings and wires).
[0040] Example 1 like Figure 1 As shown, this embodiment provides a method for detecting transmission line defects based on selective direction sensing. The method includes the following steps: S1: Acquire images of power transmission line inspections and extract features to obtain a preliminary feature map; perform feature enhancement processing on the preliminary feature map: group the features in the channel dimension and extract structure-aware features and detail texture features respectively, while retaining some original features; fuse the features of each group, perform channel-weighted enhancement on the fused features, and then fuse them with the preliminary feature map to obtain an enhanced feature map; S101: The input image first enters the enhanced backbone network. To enhance the backbone network's ability to represent features of minute defects in transmission lines, this invention introduces a Selective Enhancement Hybrid Module (SEMB) into the backbone network (such as ResNet18). This module improves the feature fidelity for small targets by differentially grouping the input feature channels and enhancing structural awareness and detail information in parallel. The specific initialization and processing includes the following two parts: I) Structure perception and grouping of detailed features Given an input feature map The SEMB module first divides it into three parts along the channel dimension and processes them separately: in, SCConv is used for spatial and channel reconstruction to suppress redundancy and enhance structural expression. Local texture and edge information are extracted using conventional 3×3 convolution; The original features are preserved directly, avoiding the dilution of effective information during the convolution process.
[0041] II) Feature Interaction and Fusion Mechanism The first two parts of the features are processed and then subjected to cross-channel interaction and fusion: in (·) indicates the SCConv operation. (·) represents a 3×3 convolution, and Shuffle(·) represents a channel shuffling operation. Here are the projection layer parameters, and σ(·) is the activation function. Final output Integration of two features: S102: Channel-aware feature recalibration mechanism: To enhance feature representation capabilities, this invention designs an attention-guided feature recalibration strategy. First, spatially independent modeling of the channel-washed features is performed using depthwise separable convolutions to enhance the capture of local details.
[0042] Building upon this, an ECA attention mechanism is integrated to recalibrate the features across channels: first, global average pooling is used to obtain global statistical descriptions of each channel, and then one-dimensional convolution is used to establish local cross-channel dependencies, generating adaptive channel attention weights. " Finally, the Sigmoid function is used to weight the features channel by channel, thereby enhancing the features of key channels. The output is... This mechanism effectively compensates for the shortcomings of depthwise separable convolution in distinguishing channel importance and improves the discriminativeness of feature representations.
[0043] S103: Final Feature Integration Output: The attention-enhanced features are fused with the preserved original features to output the following: S2: The enhanced feature map is serialized and positional encoding is added to obtain a positional encoding feature sequence. Then, global attention is calculated on the positional encoding feature sequence to obtain global association features. The global association features are subjected to the first level of local recalibration to supplement the local details lost in the global calculation, resulting in primary restored features. The primary restored features are then enhanced through a feedforward network to obtain enhanced features. The enhanced features are subjected to the second level of local recalibration to further improve the discriminative power of local details, resulting in encoded features. To overcome the smoothing effect of local fine-grained features during the global self-attention calculation process of traditional Transformer encoders and improve their ability to discern details of transmission line defects, this invention designs a feature recalibration mechanism. This mechanism embeds a multi-stage local enhancement module (Mona) into the encoder, performing feature recalibration after the outputs of the multi-head self-attention layer and the feedforward network layer, effectively restoring and enhancing the detailed information crucial for defect detection. The detailed process is as follows: S201: Input Feature Preprocessing Input feature map Flatten into a sequence And add position encoding , forming encoder input Through serialization, two-dimensional spatial features are converted into one-dimensional sequence representations, providing structured input for subsequent attention calculations.
[0044] S202: Local Feature Recalibration Mechanism Mona modules are inserted after the multi-head self-attention and feedforward network layers of the encoder, and the core calculation process is as follows: Where LN(·) represents layer normalization, and s1 and s2 are learnable weights; , These are dimensionality reduction and dimensionality expansion projections, respectively. and These are residual structures with multi-scale depthwise convolution and pointwise convolution, respectively. It is a non-linear activation.
[0045] Specifically, a first-level recalibration is performed after the attention layer: This step refines the features of the global attention output locally, supplementing the subtle structural information that may be lost in long-range dependency modeling.
[0046] Perform a second-stage recalibration after the feedforward network: This level of recalibration further enhances the discriminative power of the features, ensuring that the output encoded features, while possessing rich semantics, retain sufficient local details for accurate defect identification. Final output features It combines global semantics with local details, providing a better feature representation for accurate detection.
[0047] S3: Multi-directional geometric features are extracted from the encoded features in parallel using multi-morphological convolutional kernels, and all directional features are concatenated in the channel dimension to form a comprehensive directional awareness feature; the preliminary feature map, enhanced feature map and comprehensive directional awareness feature are weighted and fused, and the fused feature is aligned and optimized using a soft nearest neighbor interpolation method; at the same time, the shallow features in the fused feature are downsampled and reorganized in the channel to obtain detail enhancement features, which are then concatenated with the aligned and optimized features to obtain the final fused feature.
[0048] This invention proposes a novel orientation-adaptive feature fusion method, replacing the traditional feature fusion strategy in FPN / PAN that only focuses on scale alignment while ignoring the target's geometric structure. Traditional methods, when fusing multi-scale features, suffer from insufficient representation of target features with significant aspect ratios due to the lack of explicit modeling of directional geometric features, thus affecting detection accuracy. The orientation-adaptive cross-scale feature fusion module designed in this invention employs multi-morphological convolutional kernels to extract directional features in parallel and combines them with an adaptive weighted fusion mechanism to achieve accurate modeling of the directional geometric structure in transmission line scenarios. The main process is as follows: S301: Parallel Extraction of Multi-directional Features The input features are first channel-projected through a 1×1 convolution, and then fed into four parallel branches for directional feature extraction. The four branches use convolution kernel sizes of (1,31) (vertical structure perception), (31,1) (lateral structure perception), (31,31) (large-scale overall geometry perception), and (1,1) (local texture), respectively. Through differentiated convolution kernel design, geometric features in different directions are explicitly captured, providing key geometric priors for subsequent fusion. S302: Directional Feature Fusion and Reconstruction Features from the four directional branches are concatenated along the channel dimension to form a comprehensive directional awareness feature. This is then remodeled using a fusion layer to re-model the overall features. This step integrates local texture, horizontal structure, vertical structure, and overall shape information to enhance the ability to express geometric structures.
[0049] S303: Adaptive Fusion of Multi-Source Features To fully integrate input features X Direction perception features and attention enhancement features This invention introduces learnable adaptive fusion weights to dynamically adjust the importance of each feature source: in, = , = , = This mechanism can dynamically optimize the fusion strategy based on the target size, directionality, and background complexity. This completes the implementation of the ADOM module's functionality (steps I-III).
[0050] S304: Cross-scale feature alignment optimization To further mitigate spatial alignment bias in traditional upsampling and downsampling processes, this invention introduces soft nearest neighbor interpolation in the upsampling path: The upsampling coefficients are dynamically adjusted according to the input and output resolution, improving the accuracy of multi-scale feature alignment. The downsampling path integrates the GSConvE module to enhance feature representation capabilities while ensuring computational efficiency.
[0051] S305: Preservation of shallow details To improve the detection capability of small targets (bolts, cracks, detachment points, etc.) on power transmission lines, this invention introduces SPDConv for downsampling and channel reconstruction in the P2 layer, allowing more shallow edges and texture details to enter the high-level feature fusion path. This method effectively enhances the characterization capability of fine-grained targets without significantly increasing computational overhead.
[0052] Specifically, The final fused features are fed into a pre-built prediction model to obtain the defect identification results. This invention designs a bounding box regression loss function that integrates angle constraints and sample difficulty adaptive mechanisms to improve the model's localization accuracy for direction-sensitive targets in transmission line scenarios. The specific implementation steps are as follows: I) Joint regression modeling based on Focaler-IoU and angle constraints This invention unifies hard sample focusing (Focaler-IoU) and directional geometric constraint (SIoU) into a single regression framework. First, it enhances the gradient weights of hard samples through a linear interval mapping of Focaler-IoU: Subsequently, an SIoU loss comprising three elements—angle, distance, and shape—is introduced: in, This represents the intersection-union ratio (IU) between the predicted bounding box and the ground truth bounding box. d represents the lower bounding threshold of the linear mapping interval (d=0 by default in the experiment), and u represents the upper bounding threshold of the linear mapping interval (u=0.95 by default in the experiment). This represents the SIoU loss function, where Δ is the angular constraint distance loss and Ω is the shape loss. For direction-sensitive loss function, For classification loss function, As an auxiliary loss function, These are the weighting coefficients for the three loss terms mentioned above. This is the Focaler-IoU value after linear mapping reconstruction.
[0053] II) Construction of Orientation-Aware Loss Focaler-SIoU This design combines orientation alignment with adaptive sample difficulty to optimize localization regression for slender structures such as insulator strings. An orientation-sensitive loss function is constructed by incorporating the angle constraint term of the SIoU loss: III) Composition of Total Detection Loss The final detection loss is a weighted sum of regression loss, classification loss, and auxiliary loss: By collaboratively optimizing the multi-task loss, a balance is achieved between classification accuracy and positioning precision in the detection model, thereby improving the overall detection performance of transmission line defects.
[0054] Example 2 This embodiment provides a detection system for a transmission line defect detection method based on selective direction sensing, including a memory and a processor. The memory stores a computer program, and the processor calls the computer program to execute the steps of any of the methods in Embodiment 1.
[0055] The specific implementation steps of this invention are as follows: Modeling requirements for representing the characteristics of power transmission line scenarios: In power transmission line inspection tasks, there are many small targets with slender structures and complex backgrounds, making it difficult for traditional detection models to simultaneously take into account both global semantics and local details. This invention constructs a Selective Direction Awareness (DETR) detection framework suitable for power transmission line scenarios, used to accurately identify typical targets such as insulator defects, hardware anomalies, and bird nests.
[0056] Structural augmentation and detail restoration in backbone networks: To address the issue of weak features in small targets that are easily overwhelmed by higher-level features, this invention introduces a Selective Enhancement Hybrid Module (SEMB) into the backbone network. This module utilizes channel grouping, spatial reconstruction, and attention recalibration mechanisms to enhance structural edge and texture features. It exhibits stronger robustness in extracting fine-grained information about transmission lines (such as cracks and delamination points), providing more discriminative local features for subsequent Transformer encoding.
[0057] Discriminative detail compensation in Transformer encoders: To address the issue of Transformer's tendency to lose local details in long-range dependency modeling, this invention embeds the AIFI_Mona local recalibration module into the encoder to perform two-stage detail recovery on the outputs of the multi-head self-attention and feedforward networks. This mechanism improves global semantic consistency while preserving key small-scale defect features, achieving joint enhancement of semantic information and local details.
[0058] Orientation-adaptive feature fusion and multi-scale geometric modeling: Many targets in power transmission lines exhibit significant directionality (e.g., the longitudinal structure of insulator strings and the horizontal structure of conductors). To address this, this invention designs a Direction Adaptive Cross-Scale Fusion Module (DACFM), which extracts multi-directional geometric features through multi-morphological convolutional kernels and combines them with adaptive weights for multi-source fusion, thereby enhancing the model's understanding of the structure of slender targets. Simultaneously, soft nearest neighbor interpolation and SPDConv are used to maintain multi-scale feature alignment and supplement shallow details, making the fused features more consistent in direction, scale, and texture.
[0059] Regression optimization based on orientation constraints and adaptation to hard samples: To further improve the localization stability of slender, defective targets, this invention constructs a Focaler-SIoU bounding box regression loss, unifying the focusing mechanism for difficult samples with angle-based geometric constraints in a single model. This loss automatically enhances the gradient contribution of highly difficult samples during regression and explicitly penalizes directional deviations, thereby improving the localization accuracy of directionally sensitive targets such as insulator strings and wires. Finally, through joint optimization with classification and auxiliary losses, the overall performance of the model is improved.
[0060] The beneficial effects of this invention are as follows: This invention addresses key challenges in power transmission line inspection tasks, such as the difficulty in detecting small targets, strong directionality, and complex backgrounds. It systematically improves the RT-DETR model, constructing a complete selective direction-aware Transformer detection framework through four aspects: backbone network feature enhancement, cross-scale directional modeling, Transformer encoder detail recovery, and direction-sensitive regression optimization. This method overcomes the bottlenecks of traditional detection models in areas such as slender structure modeling, shallow detail preservation, and multi-scale fusion, achieving higher accuracy and more stable power transmission line defect detection.
[0061] (1) Improved overall model adaptability: Based on the end-to-end detection framework of RT-DETR, this invention adapts the overall feature processing approach of the model to the task level, taking into account the characteristics of long, thin, small-scale, highly directional, and complex backgrounds of targets in transmission line inspection. By clarifying the feature requirements, directional structural characteristics, and fine-grained expression requirements for transmission line targets, a unified improvement direction is established for the subsequent targeted optimization of each key module, enabling RT-DETR to better fit the detection characteristics of transmission line scenarios.
[0062] (2) Key Algorithm Optimization: To address the challenges of complex features and significant directional changes in transmission lines, this invention employs a multi-module approach for joint improvement. A structure enhancement module is embedded in the backbone network to enhance feature fidelity for small targets; a direction adaptation mechanism is introduced in the feature fusion stage to enhance explicit modeling of geometric structures; and a detail recovery module is integrated into the Transformer encoder to compensate for lost local texture information during global attention. Furthermore, a direction-sensitive regression loss is designed to improve the localization accuracy of elongated targets. These improvements form a closed-loop optimization from feature extraction and fusion to regression output, significantly enhancing the model's performance in complex scenarios.
[0063] (3) Scene adaptability and task verification: The improved model was tested in typical power transmission line inspection scenarios (backlight, obstruction, long-distance shooting, complex background). The results showed that the model was significantly improved in terms of small target retention rate, direction recognition ability and detection consistency compared with the original RT-DETR, proving that it has good task adaptability and engineering usability.
[0064] (4) High detection accuracy: Through the direction-aware feature fusion and detail recovery mechanism, this method achieves higher recall and positioning accuracy in the small target detection task of transmission lines, especially in the geometric alignment of slender targets such as insulator strings and bird nests.
[0065] (5) Strong robustness: The model can still maintain stable detection performance in challenging inspection environments such as complex backgrounds, partial occlusion, and changes in lighting, demonstrating good environmental adaptability and anti-interference ability.
[0066] (6) High real-time performance: Based on the real-time detector RTDETR, it is optimized to meet the real-time processing requirements of the UAV platform while ensuring detection accuracy, and has strong engineering application potential.
[0067] The first research content of this invention is to complete the overall adaptive design of RT-DETR in transmission line inspection tasks, laying the foundation for subsequent improvements; the second research content is to optimize the features and algorithms of key links, which is the core of performance improvement; the third research content is to verify the applicability of the model through multi-scenario testing, which belongs to the application and effect verification of the first two works.
[0068] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A method for detecting defects in transmission lines based on selective direction sensing, characterized in that, include: Images of power transmission lines during inspections are acquired and features are extracted to obtain preliminary feature maps. The preliminary feature map is subjected to feature enhancement processing: the features are grouped in the channel dimension and structure-aware features and detail texture features are extracted separately, while retaining some original features; the features of each group are fused, and the fused features are enhanced by channel weighting, and then fused with the preliminary feature map to obtain the enhanced feature map; The enhanced feature map is serialized and positional encoding is added to obtain a positional encoding feature sequence. Then, global attention is calculated on the positional encoding feature sequence to obtain global association features. The global correlation features are subjected to a first-level local recalibration to supplement the local details lost in the global calculation, resulting in primary restored features; then, the primary restored features are enhanced through a feedforward network to obtain enhanced features. The enhanced features are then subjected to a second-level local recalibration to further improve the discriminative power of local details, resulting in encoded features. Multi-directional geometric features are extracted from the encoded features in parallel using multi-morphological convolutional kernels, and all directional features are concatenated along the channel dimension to form a comprehensive directional awareness feature. The preliminary feature map, enhanced feature map, and comprehensive directional awareness feature are weighted and fused, and the fused feature is aligned and optimized using a soft nearest neighbor interpolation method. At the same time, the shallow features in the fused feature are downsampled and reorganized along the channels to obtain detail enhancement features, which are then concatenated with the aligned and optimized features to obtain the final fused feature.
2. The method for detecting transmission line defects based on selective direction sensing according to claim 1, characterized in that, The feature enhancement process specifically includes: The features are grouped along the channel dimension, and structure-aware features and detail texture features are extracted separately, while retaining some of the original features, resulting in: in, This is a structurally perceptible feature. For detailed texture features, To preserve some of the original features; C represents the total number of channels, H represents the feature map height, and W represents the feature map width; First, the structure-aware features and detail texture features are interacted and fused across channels, and then integrated with the retained original features to obtain the fused features: in, The characteristics after fusion This indicates a channel mixing operation. Represents the projected features. , Here are the projection layer parameters, and σ(·) is the activation function. It is a 3×3 convolution. Features after splicing This indicates the SCConv operation, and Shuffle(·) is the channel shuffling operation.
3. The method for detecting transmission line defects based on selective direction sensing according to claim 2, characterized in that, The fused features are enhanced using an attention mechanism with channel weighting, the specific process of which includes: First, global average pooling is used to obtain the global statistical description of each channel. Then, one-dimensional convolution is used to establish local cross-channel dependencies and generate adaptive channel attention weights. Finally, the fused features are weighted channel by channel using the Sigmoid function to enhance the features of key channels, and the output is... Then The enhanced feature map is obtained by fusing it with the retained original features, and is represented as follows: in, The features are obtained by weighting each channel. To preserve some of the original features.
4. The method for detecting transmission line defects based on selective direction sensing according to claim 3, characterized in that, The enhanced feature map is flattened into a one-dimensional sequence and positional encoding is added. Then, global attention is calculated to obtain the global associated features. The global correlation features are subjected to a first-level local recalibration to obtain primary recovery features. The calculation formula for the primary recovery features is as follows: Where x is the input feature tensor, LN(·) denotes layer normalization, and s1 and s2 are learnable weights; , These are dimensionality reduction and dimensionality expansion projections, respectively. and These are residual structures with multi-scale depthwise convolution and pointwise convolution, respectively. Nonlinear activation; This is a primary recovery characteristic. Representation layer normalization, This indicates a shape rearrangement operation. The flattened feature sequence, For position encoding.
5. The method for detecting transmission line defects based on selective direction sensing according to claim 4, characterized in that, The primary recovered features are enhanced using a feedforward network to obtain enhanced features. The enhanced features are then subjected to a second-level local recalibration to obtain the encoded features, which are calculated using the following formula: in, This indicates a feedforward fully connected network. These are encoding features.
6. The method for detecting transmission line defects based on selective direction sensing according to claim 1, characterized in that, The multi-directional geometric features specifically include vertical structure perception features, horizontal structure perception features, overall geometric perception features, and local texture features; these multi-directional geometric features are concatenated along the channel dimension to form a comprehensive direction perception feature, the concatenation expression being: in, The characteristics of the i-th directional branch are represented. This indicates that the size used is k. h ×k w Depthwise separable convolutions are used to extract orientation-aware features from input features X, where X represents the input features. Represents the perceived features of vertical structure. This represents the perceptual features of lateral structure. Represents the overall geometric perception features. Represents local texture features. This represents the feature fusion layer.
7. The method for detecting transmission line defects based on selective direction sensing according to claim 6, characterized in that, By introducing learnable adaptive fusion weights, the comprehensive direction-aware features are weighted and fused with the preliminary feature map and the enhanced feature map to obtain the fused features. The fusion expression is as follows: in, Features after fusion For learnable adaptive weight coefficients, These are the normalized weight values. These are the learnable raw weight parameters. This is the output of the i-th feature branch.
8. The method for detecting transmission line defects based on selective direction sensing according to claim 7, characterized in that, The fused features are aligned using a soft nearest neighbor interpolation method, and the alignment expression is as follows: Where Y represents the upsampled high-level feature map. This is a soft factor in soft nearest neighbor interpolation (SNI), used to dynamically adjust the weights of high-level semantic features. The input is a high-level semantic feature map. This indicates the nearest neighbor interpolation operation. ) represents the spatial resolution of the input feature map X. This represents the spatial resolution of the output feature map Y.
9. The method for detecting transmission line defects based on selective direction sensing according to claim 1, characterized in that, The final fused features are fed into a pre-built prediction model to obtain the defect identification result. The prediction model is trained using a pre-built loss function based on a fused sample focusing mechanism and directional geometric constraints. The loss function is obtained by weighted fusion of a pre-built orientation-sensitive loss function, a classification loss function, and an auxiliary loss function. The specific expression of the loss function is as follows: in, The intersection-over-union ratio (IoU) represents the predicted bounding box and the ground truth bounding box; d represents the lower bounding threshold of the linear mapping interval; and u represents the upper bounding threshold of the linear mapping interval. This represents the SIoU loss function, where Δ is the angular constraint distance loss and Ω is the shape loss. For direction-sensitive loss function, For classification loss function, As an auxiliary loss function, These are the weighting coefficients for the three loss terms. This is the Focaler-IoU value after linear mapping reconstruction.
10. A detection system for a transmission line defect detection method based on selective direction sensing, characterized in that, It includes a memory and a processor, the memory storing a computer program, the processor invoking the computer program to perform the steps of the method as described in any one of claims 1 to 9.