TL-DETR: Efficient transmission line defect detection for edge deployment Authors: Yong Zhang, Runming Zhao Published: 2026 ABSTRACT Visual inspection is critical for power system maintenance, yet deploying high-performance detection models on resource-constrained edge devices remains challenging due to complex background interference, extreme defect scale variations, and high computational overhead. This paper presents TL-DETR, a specialized detection framework that integrates multi-scale feature enhancement and dynamic sparse attention to achieve accurate and efficient transmission line defect detection for edge deployment. First, a ResNet-50-TL backbone network incorporating a multi-scale feature enhancement module is designed to preserve fine-grained features. Subsequently, the neck network integrates Attention-based Intra-scale Bi-level Routing and a channel shuffle mechanism to precisely focus on critical defects and reduce parameter count. Furthermore, a multi-scale attention mechanism is introduced to accomplish pixel-level recalibration through cross-spatial learning. Experiments on the CableInspect-ADs dataset demonstrate that the precision and mAP50 of TL-DETR reach 91.4% and 86.0%, respectively, representing improvements of 3.2% and 2.9% over the baseline RT-DETR. These results indicate that the model effectively balances accuracy and computational efficiency, demonstrating theoretical viability for practical edge deployment. Generalization experiments confirm that the model exhibits excellent generalization capabilities for detecting insulators, vibration dampers, and bolts, aligning closely with the engineering requirements for precise perception of minute defects. Introduction Modern power systems, which serve as the energy arteries supporting societal operations, are experiencing a synergistic advancement of scale expansion and technological innovation [1]. With the construction of the global energy internet and the extensive integration of renewable energy, the scale of power transmission infrastructure has reached an unprecedented level. According to the latest report from the International Energy Agency, to achieve the energy transition and climate goals of various countries, more than 80 million kilometers of new or refurbished transmission and distribution lines will be needed globally by 2040 [2]. As the core channels for power delivery, the safety and stability of transmission lines are directly related to the reliable operation of the entire power grid, necessitating regular and meticulous inspections [3–5]. However, the explosive growth in the scale of the power grid has brought severe challenges to traditional operation and maintenance models; the per capita inspection mileage for personnel is rising year by year, and the traditional manual inspection mode is inadequate to address the growing maintenance demands [6]. Therefore, seeking efficient and safe automated inspection technologies has become an urgent requirement of the industry. In recent years, computer vision-based automated defect detection technology has evolved from traditional machine learning that relies on manually designed features (such as Haar features [7] and Histogram of Oriented Gradients [8]) to deep learning-driven approaches. Convolutional Neural Networks (CNNs) represented by the R-CNN series [9–12], YOLO [13], and SSD [14] have significantly improved detection accuracy and speed. Meanwhile, with the introduction of the Transformer [15], DETR [16], and its derivative model RT-DETR (Real-Time Detection Transformer) [17], these models achieved further breakthroughs in vision tasks, thanks to their “set prediction” and end-to-end advantages. With the application of deep learning in power line inspection, existing research has made significant progress, and its technical focus is shifting from “centralized high-precision computing in the cloud” to “high-efficiency collaboration at the edge”. In the pursuit of accuracy, many solutions relied heavily on “centralized cloud processing” to support complex network designs. For example, Aohua Li et al.[18] designed a cascaded framework combining YOLOv5s and U-Net, which effectively improved the segmentation performance of defect regions. To address dense small-object detection in complex backgrounds, both TLI-DETR and PLD-DETR [19,20] enhanced their perception of key transmission line components by introducing attention mechanisms and feature fusion modules. For specific transmission line fittings, Wenxia Bao et al.[21] and Zhang Ke et al.[22] proposed PMA-YOLO and a knowledge-reasoning-based PA-DETR, respectively, which effectively addressed the discrimination challenges posed by small vibration damper targets and visually indistinguishable bolts. However, when facing massive concurrent uploads of high-definition images, these computation-intensive models are highly prone to network congestion, and their data transmission latency severely hinders real-time feedback on faults. To break through this timeliness bottleneck, the “cloud-edge-device collaborative” mode, which pushes computing power to the edge, has become an inevitable trend in automated inspection. Many scholars have begun seeking a balance between speed and accuracy under limited edge-computing power constraints. For instance, to address the challenges posed by complex backgrounds and occlusions, Jinyu Wang et al.[23] used statistical prior information to construct an enhanced DETR framework that improves the speed of small-object detection. Pei Dongfeng et al.[24] proposed the RT-DETR-MBD model by constructing a lightweight backbone, achieving highly efficient edge detection while significantly reducing parameter count. Furthermore, for lightweight identification of specific defects, Jinxing Niu et al.[25] and Zhilong Yu et al.[26] proposed the SL-YOLOv8 and DFCG_YOLOv5 algorithms, respectively, incorporating filtering and noise reduction, achieving dual improvements in accuracy and speed on engineering data. With the widespread adoption of deep learning in industry, researchers have begun to explore more generalizable and interpretable advanced condition-monitoring and diagnosis paradigms. For example, in the field of intelligent diagnosis of complex industrial equipment, multimodal data fusion technology has made significant progress. You et al. constructed a heterogeneous fusion model based on liquid-impulse neural networks to enhance temporal feature extraction [27], and achieved intelligent fusion and interpretability quantification of acoustic-vibration signals through an attention mechanism [28]. Furthermore, to overcome the difficulty of scarce real fault samples, physics-informed neural networks (PINN) have been introduced into data-driven networks, enabling high-precision diagnosis under zero-fault sample conditions [29]; further, a multi-edge physical information digital twin framework demonstrated excellent diagnostic performance through the dynamic interaction of virtual and real signals, even without real fault samples and under strong noise interference [30]. These cutting-edge studies provide high-precision, highly robust solutions for the intelligent operation and maintenance of critical industrial equipment, and also offer valuable theoretical references for the intelligent upgrade of power systems. However, constrained by the single visual perception of UAVs and the limitations of edge computing, the aforementioned advanced models that rely on multi-sensor data or complex simulations are difficult to implement, and current inspection tasks still heavily rely on pure-vision lightweight detection models. Nevertheless, existing models still face three major limitations in practical applications: firstly, there is a natural contradiction between computing power and perception, and lightweight design is usually achieved at the expense of the depth and breadth of feature extraction; secondly, fine-grained features are highly susceptible to loss, and when confronting weak defects highly integrated with complex backgrounds, such as broken or spaced strands, the model’s perceptual capability decreases sharply, making it prone to missed or false detections; finally, public datasets are scarce and defect types are simplistic, with existing research mostly restricted to single components and binary classifications of “presence or absence of defects,” lacking the support of a refined, full-chain dataset and a comprehensive detection system. To address the above issues, this paper proposes TL-DETR (Transmission-Line Detection Transformer), a high-accuracy transmission-line defect-detection model designed for edge devices. Unlike methods that solely pursue extreme lightweighting, this study aims to maximize the model’s perception capability for fine-grained defects while maintaining an acceptable level of edge computing power. The main contributions of this paper are as follows: Dataset Enhancement and Construction: Based on real natural environment backgrounds, the CableInspect-ADs overhead line dataset was expanded and constructed, and the Transmission-Line-Fittings dataset covering insulators, bolts, and vibration dampers was collected and built, forming a complete chain of transmission line datasets. Dataset Enhancement and Construction: Based on real natural environment backgrounds, the CableInspect-ADs overhead line dataset was expanded and constructed, and the Transmission-Line-Fittings dataset covering insulators, bolts, and vibration dampers was collected and built, forming a complete chain of transmission line datasets. Multi-Scale Feature Enhancement: The ResNet-50 backbone network is enhanced by introducing a Multi-Scale Feature Enhancement (MSFE) module. Through parallel multi-scale pathways based on Depthwise Separable Convolution (DWConv), the effective receptive field is expanded with extremely low computational overhead, preserving the geometric details of minute defects from the source. Multi-Scale Feature Enhancement: The ResNet-50 backbone network is enhanced by introducing a Multi-Scale Feature Enhancement (MSFE) module. Through parallel multi-scale pathways based on Depthwise Separable Convolution (DWConv), the effective receptive field is expanded with extremely low computational overhead, preserving the geometric details of minute defects from the source. Hybrid Attention Neck Optimization: First, an Attention-based Intra-scale Bi-level Routing (AIBR), adapted from BiFormer, is utilized to filter background noise and focus on defects through dynamic sparse computation. Second, a ShuffleC3 module is integrated to significantly reduce parameter redundancy via a channel-shuffling mechanism. Finally, an Efficient Multi-Scale Attention (EMA) is introduced to perform feature recalibration via cross-spatial learning. The integration of these three components enables high-accuracy minute-object capture at low computational cost. Hybrid Attention Neck Optimization: First, an Attention-based Intra-scale Bi-level Routing (AIBR), adapted from BiFormer, is utilized to filter background noise and focus on defects through dynamic sparse computation. Second, a ShuffleC3 module is integrated to significantly reduce parameter redundancy via a channel-shuffling mechanism. Finally, an Efficient Multi-Scale Attention (EMA) is introduced to perform feature recalibration via cross-spatial learning. The integration of these three components enables high-accuracy minute-object capture at low computational cost. Experimental Validation: Experiments on the aforementioned self-built datasets demonstrate that TL-DETR outperforms existing mainstream methods in key metrics such as precision, recall, and mAP50, achieving an excellent balance between detection accuracy and inference speed at the edge. Experimental Validation: Experiments on the aforementioned self-built datasets demonstrate that TL-DETR outperforms existing mainstream methods in key metrics such as precision, recall, and mAP50, achieving an excellent balance between detection accuracy and inference speed at the edge. Related work Baseline model RT-DETR. The core design philosophy of RT-DETR (Real-Time Detection Transformer) [17] is to address the high computational complexity and slow inference speed inherent in traditional DETR models. Consequently, it proposes an “efficient hybrid encoder” architecture that applies the Transformer’s attention mechanism exclusively to high-level features while using convolutional networks for multi-scale fusion. The flowchart of the RT-DETR model is shown in Fig 1, and its workflow can be divided into three parts. Workflow of the RT-DETR model. The first part is the backbone network, employing ResNet-50 to extract image features. It outputs three feature maps of different scales, denoted as S3, S4, and S5. S3 has a higher resolution (1/8 of the original image) and contains abundant geometric details, such as edges and textures, but weaker semantic information; S4 has a medium resolution (1/16); and S5 has the lowest resolution (1/32) but contains the richest high-level semantic information, despite relatively blurred spatial positioning. The second part is the Efficient Hybrid Encoder, representing the core innovation of RT-DETR. It splits the encoder into AIFI (Attention-based Intra-scale Feature Interaction) and CCFF (Cross-scale Feature-fusion) modules. Specifically, the AIFI module processes only the highest-level S5 feature map using the Transformer’s self-attention to capture global context, effectively avoiding the massive computational overhead of calculating attention across all scales. The CCFF module adopts a convolution-based cross-scale fusion strategy (similar to FPN/PANet), bi-directionally fusing high-level semantic features from AIFI with low- and medium-level detail features (S3, S4) to generate high-quality representations that capture both global semantics and local details. The third part is the Transformer Decoder & Head, responsible for final object prediction. RT-DETR introduces a “query selection” mechanism, abandoning static, zero-initialized queries from the traditional DETR framework. Instead, it directly filters the top-K features with the highest confidence scores from the encoder’s output to serve as initial object queries, performing an efficient “pre-screening.” Subsequently, these queries are fed into the multi-layer Transformer decoder, which continuously interacts with and updates image features via the cross-attention mechanism. Finally, the prediction head directly outputs object categories and bounding boxes without Non-Maximum Suppression (NMS) post-processing, achieving true end-to-end, real-time detection. Attention mechanism In the specific scenario of transmission line inspection, images are typically characterized by complex backgrounds and minute defect scales. This “low signal-to-noise ratio” characteristic makes it difficult for traditional convolutional networks to accurately focus on minute defects while suppressing the background. To address this issue, attention mechanisms have been widely introduced, aiming to simulate the human visual system’s ability to focus on salient regions, thereby enhancing target features and suppressing irrelevant backgrounds through dynamic weight allocation. The attention mechanism has become a key technology for improving the feature extraction efficiency of deep learning models by simulating the human visual system’s ability to focus on salient regions. In early convolutional neural networks, SE-Net (Squeeze-and-Excitation Networks) [31] significantly improved model performance by reweighting channel attention. Subsequently, CBAM (Convolutional Block Attention Module) [32] further integrated spatial and channel dimensions, achieving finer feature calibration. Shuai Hao et al.[33] introduced the CBAM attention mechanism into a transmission line inspection model, effectively improving its accuracy by embedding a spatial- and channel-adaptive feature enhancement module into the backbone network. Meanwhile, with the introduction of the Transformer architecture, the Self-Attention mechanism has achieved breakthroughs in object detection tasks by virtue of its powerful global context modeling [15]. However, traditional Global Self-Attention faces a massive computational burden, as its computational complexity grows quadratically with the length of the input feature sequence, and it is highly susceptible to background noise interference, which is particularly fatal in the complex backgrounds of transmission lines [34]. To this end, researchers have developed various lightweight vision models oriented towards edge devices. For example, MobileViT [35] integrates the local inductive bias of convolutions with the global modeling capacity of Transformers; EdgeFormer [36] significantly reduces on-device resource consumption through a parameter-efficient design; EfficientFormer [37] elevates Transformer inference speed to the level of traditional CNNs by relying on a latency-driven slimming strategy; furthermore, the classic Swin Transformer [38] introduces a local self-attention mechanism based on shifted windows, successfully reducing the quadratic computational complexity of global attention to linear, thereby providing an efficient paradigm for lightweight design. Beyond architectural lightweight explorations, recent studies have also focused on targeted attention optimizations in defect detection to address the challenges posed by complex transmission line backgrounds and the high susceptibility of small object features to loss. For instance, to tackle the problem of small object feature loss in complex backgrounds, the aforementioned TLI-DETR model [19] significantly enhances the model’s perceptual capability for subtle faults by introducing a channel-spatial fusion cross-attention mechanism; the PLD-DETR model [20] further introduces a Local Cross Attention module, which effectively suppresses redundant noise interference in the backgrounds of transmission line insulator strings and towers by focusing on local feature interactions. Aiming at the missed detection of small objects caused by complex backgrounds and object occlusion in UAV inspection images, Tan et al. [39] derived multi-scale attention feature maps based on an ultra-lightweight subspace attention mechanism (ULSAM) and combined them with Soft-NMS to significantly reduce the missed detection rate. Meanwhile, facing the challenges of scarce industrial surface defect samples and variable appearances, the MaMiNet model proposed by Luo et al. [40] introduced a Memory Attention feature enhancement module, which effectively improves the network’s discriminative feature representation capability for various defect regions by capturing attention information across samples. Furthermore, the MAP-YOLOv8 model proposed by Xu et al. [41] employs a Mixed Pooling Channel Attention mechanism that effectively integrates global and local contextual information while preserving key texture details by aggregating global average pooling and maximum pooling features in parallel, thereby further improving recognition accuracy. To further retain key features while reducing computational complexity, researchers have proposed various sparse attention paradigms. For example, SparseViT [42] introduces a dynamic pruning mechanism based on importance scoring, which highly concentrates computational resources on foreground objects by progressively eliminating low-information background tokens in deep networks. In other evolutions of the DETR series models, the optimization of computational efficiency and accuracy is also a core direction: Deformable DETR [34] proposes a deformable sampling mechanism that effectively alleviates computational pressure and accelerates model convergence by focusing only on a small set of key sampling points near reference points; Dynamic DETR [43] achieves adaptive adjustment across different scales, spatial locations, and feature attributes by introducing multi-dimensional dynamic attention, which further enhances perceptual accuracy. In addition, the Bi-Level Routing Attention proposed by BiFormer [44] dynamically constructs routing graphs to compute attention only among semantically relevant regions. This “dynamic sparse” strategy not only drastically reduces GPU memory overhead but also better aligns with the edge deployment requirements of transmission line inspections. Methods Improved TL-DETR In the actual inspection process of transmission lines, the ideal approach is a “cloud-edge-device collaborative architecture,” as shown in Fig 2, where the object detection algorithm is deployed on edge devices to process data, thereby improving inspection efficiency. To meet the lightweight requirements of edge deployment and to resolve the issues of feature extraction redundancy and insufficient perception of small objects inherent in the original RT-DETR model when processing fine-grained industrial defects, this paper proposes an improved model—TL-DETR. While retaining the real-time advantages of the baseline RT-DETR-ResNet50 architecture, this model focuses on the targeted adaptation and optimization of the backbone and neck networks. Its core improvements comprise the following three aspects: Schematic diagram of the cloud-edge-device collaborative architecture. First, the backbone network is improved. To address the issue where the traditional ResNet-50 easily loses minute object details during continuous downsampling and the receptive field of a single 3 × 3 convolution is limited, a ResNet-50-TL backbone network incorporating an MSFE (Multi-Scale Feature Enhancement) module is constructed. By replacing the last residual block of each stage, the MSFE introduces multi-path parallel branches to expand the effective receptive field. Meanwhile, to prevent a surge in computational overhead caused by large-scale feature extraction, this module comprehensively adopts Depthwise Separable Convolutions (DWConv), thereby strengthening the capture of minute defects from the source at an extremely low parameter cost and ultimately achieving a balance between high perception performance and edge lightweighting. Second, a dynamic sparse and lightweight neck is adapted. In the Hybrid Encoder stage, the AIBR module is initially introduced to replace the original AIFI module, aiming to reconstruct the high-level feature interaction mechanism. Through dynamic sparse computation, it automatically filters redundant noise in the power transmission background, achieving precise focusing on critical defect regions. Simultaneously, a ShuffleC3 module based on a channel shuffle mechanism is designed to replace the original RepC3. This significantly reduces the model’s parameter count and computational complexity while preserving the flow of feature information, making it well-suited for edge deployment. Third, global feature recalibration is conducted. The EMA module is introduced at the end of the feature fusion process. By leveraging its unique Cross-Spatial Learning mechanism to aggregate global contextual information, it performs pixel-level recalibration and purification of the output features, further resolving the issue of insufficient localization precision for minute defects. Workflow of the TL-DETR model as shown in Fig 3. Workflow of the TL-DETR model. Improvement of the ResNet-50-TL backbone network Given the minute scales and complex textures of defect targets (e.g., broken strands and wear) in transmission line inspection scenarios, the traditional ResNet-50 backbone network suffers from dual limitations: high-frequency detail loss and fixed receptive fields during continuous downsampling. To resolve this issue, this paper proposes an improved ResNet-50-TL backbone network. A comparison between ResNet-50 and ResNet-50-TL is shown in Fig 4. Its core strategy is to introduce the MSFE module at the end of Stage 2 through Stage 4 in the original network, replacing the standard residual blocks. The MSFE adopts a “split-transform-fuse” parallel topology, which essentially arranges multi-branch depthwise separable convolutions in parallel, to work synergistically to enhance the model’s representation of minute defects from the source. Structure of the backbone network: (a) ResNet-50; (b) ResNet-50-TL. Specifically, the MSFE module splits the input feature X∈RC×H×W into two parallel perception branches. To multiply the receptive field while strictly controlling computational complexity for edge deployment adaptation, the MSFE module discards traditional large-kernel standard convolutions and introduces DWConv in a comprehensive manner. The fine-grained local perception branch aims to capture minute textures. It first performs dimensionality reduction through a 1 × 1 convolution (with SiLU activation), and then further splits into two paths, utilizing 3 × 3 and 5 × 5 depthwise separable convolutions (i.e., k × k DWConv for spatial extraction + 1 × 1 Conv for channel fusion) respectively to extract spatial features of different granularities. Finally, they are concatenated along the channel dimension and fused by a 1 × 1 convolution. The coarse-grained global perception branch utilizes a 7 × 7 depthwise separable convolution to capture the global context of elongated defects. The structure of the MSFE module is illustrated in Fig 5. Structure of the MSFE module. Mathematically, let F1×1(·) be the 1 × 1 standard convolution operator including batch normalization, FDWS_k×k be the depthwise separable convolution operator including k×k DWConv and 1 × 1 Conv, and σ be the SiLU activation function. The feature extraction processes of the two branches can be formally expressed as follows: where X′ is the intermediate feature after dimensionality reduction preprocessing, and Ylocal and Yglobal represent the local and global feature responses, respectively. Ultimately, the module aggregates the information from the two branches through element-wise summation to form an output feature with multi-scale response capabilities: Through this design, ResNet-50-TL successfully resolves the dilemma of parameter explosion caused by multi-scale large-kernel convolutions. By leveraging DWConv’s extremely high computational compression ratio, it constructs a parallel, synergistic feature pyramid-style spatial response mechanism without introducing computational burden. This effectively solves the problem of feature submergence caused by minute defects in deep networks, achieving high-quality feature extraction optimized for edge devices. Hybrid attention neck optimization Dynamic sparse attention based on intra-scale bi-level routing. In transmission line inspection images, key targets such as overhead lines and insulators often occupy only tiny spatial regions, while the majority of the image is occupied by redundant backgrounds. Traditional global self-attention mechanisms force interactions across all pixel pairs in the entire image; this not only causes the computational complexity to grow quadratically at O((HW)2) but also introduces a massive amount of noise interference from irrelevant backgrounds, thereby diluting the model’s focus on minute defects. To resolve this issue, this paper adapts the Bi-Level Routing Attention module from BiFormer [44] to serve as the AIBR module. As shown in Fig 6, this module adopts a dynamic sparse strategy of “routing first, computing later,” establishing long-range dependencies only between semantically highly relevant regions by filtering out irrelevant background areas. Network architecture of the Attention-based Intra-scale Bi-level Routing. Specifically, AIBR first divides the input feature map X∈RH×W×C into S×S non-overlapping physical regions, with each region containing HWS2 feature vectors. Query, Key, and Value tensors are generated respectively through linear mapping. To determine which regions require attention interaction, the model constructs a directed routing graph by calculating the semantic relevance between regions. First, average pooling is performed on the features within each region to obtain region-level query and key vectors. Subsequently, the adjacency matrix between regions is calculated, and a Top-k strategy is utilized to retain the k associated regions with the highest semantic relevance, generating the routing index: where the i-th row in Lr contains the indices of the k regions that are most semantically relevant to the i-th region, thereby excluding the interference of massive irrelevant background regions. In the fine-grained computation stage, the model gathers key-value pairs only from the associated regions based on the routing index Lr, and calculates the final sparse attention combined with a Local Context Enhancement (LCE) term. Defining Attention(·) as the standard multi-head attention operator, this process can be formally expressed as: Through this mechanism, AIBR restricts the attention computation to a small set of key regions filtered by routing. To rigorously illustrate its optimization of complexity, assume the input feature map resolution is H×W and the number of channels is C. The complexity of traditional global self-attention is 4HWC2+2(HW)2C, which grows quadratically with spatial resolution. However, after introducing the S×S division and Top-k sparse routing, the complexity of AIBR becomes: When the routing parameters are reasonably set (i.e., k