A method and system for detecting defects of a power transmission line cotter

CN122948737APending Publication Date: 2026-10-20SHANDONG ACAD OF SCI INST OF AUTOMATION +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610785578.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-02
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0005]为了解决现有技术的不足,本发明提供了一种针对输电线路开口销缺陷的检测方法及系统,能够在不引入复杂结构,保证实时性的前提下,提高开口销缺陷检测的精度与鲁棒性,以满足输电线路等复杂工业场景的实际应用需求

Benefits of technology

本发明在颈部网络采用增强型广义特征金字塔网络替换YOLOv8模型原有的PANet结构,同时在增强型广义特征金字塔网络之前,设置多尺度功率融合模块,通过增强型广义特征金字塔网络和多尺度功率融合模块的配合,实现了跨尺度特征的高效对齐与融合。改进后的颈部网络不仅保留了浅层的精细空间信息,还增强了深层语义特征的传递效率,有效缓解了小目标特征在深层网络中易被稀释的问题,显著提升了多尺度目标的检测一致性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention relates to the fields of computer vision and intelligent detection technology, and provides a method and system for detecting cotter pin defects in power transmission lines: acquiring images of power transmission lines containing cotter pins; performing detection and recognition using a preset target detection model; the preset target detection model adopts an improved YOLOv8, including a backbone network, a neck network, and a detection head; replacing the PANet structure with an enhanced generalized feature pyramid network, and replacing the C2f module with a C2f-HTE module, the C2f-HTE module fusing a hybrid texture enhanced attention mechanism and a multi-scale attention mechanism; and setting a multi-scale power fusion module before the enhanced generalized feature pyramid network in the neck network. This invention can effectively improve the recall and precision of detecting small defect targets in complex environments, and has strong robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and intelligent inspection technology, and in particular to a method and system for detecting defects in cotter pins of power transmission lines. Background Technology

[0002] Transmission lines are constantly exposed to factors such as wind vibration, temperature differences, and impacts from foreign objects, which can easily cause the cotter pins at their connection points to loosen or even fall off. The loss of cotter pins directly threatens the structural safety and operational stability of the line. Therefore, timely and accurate detection of missing cotter pins in transmission lines is a crucial step in ensuring the safe operation of the power system.

[0003] With the popularization of drone inspection technology and the development of computer vision, deep learning-based automatic detection methods have gradually become a research hotspot. Among them, single-stage target detection algorithms have received widespread attention in industrial inspection due to their advantages such as fast detection speed and flexible deployment.

[0004] However, in practical applications of cotter pin defect detection for power transmission lines, targets often exhibit imaging characteristics such as small size, weak texture, strong reflectivity of metal surfaces, and drastic changes in illumination. These characteristics pose numerous challenges to existing single-stage target detection algorithms: small targets are prone to losing shallow detail information in deep networks, resulting in insufficient feature representation capabilities; the highlight areas generated by metal components under strong light can easily cause spurious activation or localization bias in the model; and the regression loss function has limited adaptability to targets with weak boundaries, making it difficult to achieve stable convergence under complex lighting conditions. Although some methods improve accuracy by introducing complex structures, this often comes at the cost of computational efficiency, making it difficult to meet the real-time requirements of UAVs or embedded platforms. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a method and system for detecting cotter pin defects in power transmission lines. This method and system can improve the accuracy and robustness of cotter pin defect detection without introducing complex structures and while ensuring real-time performance, thus meeting the practical application needs of complex industrial scenarios such as power transmission lines.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: Firstly, a method for detecting defects in cotter pins of transmission lines is provided, including: Obtain images of transmission lines containing cotter pins; Based on the acquired image of the transmission line containing cotter pins and the preset target detection model, target detection is performed to obtain the target detection results and complete the detection and identification of cotter pin defects. The preset target detection model adopts an improved YOLOv8 model, including a backbone network, a neck network, and a detection head. An enhanced generalized feature pyramid network replaces the PANet structure in the YOLOv8 neck network, and the original C2f module in the neck network is replaced with a C2f-HTE module. The C2f-HTE module integrates a hybrid texture enhanced attention mechanism and a multi-scale attention mechanism. In the neck network, a multi-scale power fusion module is set before the enhanced generalized feature pyramid network.

[0007] Secondly, a defect detection system for cotter pins in transmission lines is provided, including: An acquisition module is configured to acquire images of transmission lines containing cotter pins; The detection module is configured to perform target detection based on the acquired image of the transmission line containing cotter pins and a preset target detection model, obtain the target detection result, and complete the detection and identification of cotter pin defects. The preset target detection model adopts an improved YOLOv8 model, including a backbone network, a neck network, and a detection head. An enhanced generalized feature pyramid network replaces the PANet structure in the YOLOv8 neck network, and the original C2f module in the neck network is replaced with a C2f-HTE module. The C2f-HTE module integrates a hybrid texture enhanced attention mechanism and a multi-scale attention mechanism. In the neck network, a multi-scale power fusion module is set before the enhanced generalized feature pyramid network.

[0008] Thirdly, an electronic device is also provided, comprising: Memory, used for non-transitory storage of computer-readable instructions; and Processor, for executing the computer-readable instructions, When the computer-readable instructions are executed by the processor, they perform the method described in the first aspect above.

[0009] Fourthly, a computer-readable storage medium is provided having a program stored thereon that, when executed by a processor, implements the method described in the first aspect above.

[0010] The above technical solution has the following advantages or beneficial effects: This invention replaces the original PANet structure of the YOLOv8 model with an enhanced generalized feature pyramid network in the neck network. Simultaneously, a multi-scale power fusion module is set before the enhanced generalized feature pyramid network. Through the cooperation of the enhanced generalized feature pyramid network and the multi-scale power fusion module, efficient alignment and fusion of cross-scale features are achieved. The improved neck network not only retains the fine spatial information of the shallow layers but also enhances the transmission efficiency of deep semantic features, effectively alleviating the problem of small target features being easily diluted in deep networks, and significantly improving the detection consistency of multi-scale targets.

[0011] This invention constructs a C2f-HTE module, which effectively solves the challenges of small target size, weak texture, and strong metal reflection interference in transmission line cotter pin detection by fusing a hybrid texture enhancement attention mechanism and a multi-scale attention mechanism. Through the synergistic effect of texture enhancement and specular suppression branches, this module strengthens local stable textures while suppressing anomalous responses in specular regions, significantly improving the model's feature representation ability and anti-interference capability for weakly textured targets, and providing more robust foundational features for subsequent multi-scale fusion and localization.

[0012] This invention adds a high-resolution detection layer to the detection head and replaces the traditional IoU loss with a hybrid HPIoU loss function. Through multiple constraints including PioU corner penalty, WIoU dynamic attention, and brightness-weighted Inner-IoU, the model's bounding box regression accuracy under complex lighting conditions is significantly improved. Experimental results show that the method of this invention outperforms existing mainstream detection models in key metrics such as mAP and recall, and the inference speed meets the real-time requirements of UAV inspection, providing an efficient and reliable solution for the automated detection of cotter pin defects in power transmission lines. Attached Figure Description

[0013] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0014] Figure 1 This is a flowchart of a method for detecting defects in cotter pins of transmission lines according to Embodiment 1 of the present invention; Figure 2 This is a diagram of the MSPF and GFPN fusion network structure in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the C2f-HTE module in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of the HTE structure in the C2f-HTE module of Embodiment 1 of the present invention; Figure 5This is a schematic diagram of the DySample unit in Embodiment 1 of the present invention; Figure 6 (a) is a schematic diagram of the Shuffle unit in Embodiment 1 of the present invention; Figure 6 (b) is a schematic diagram of the improved CoorAtt unit in Embodiment 1 of the present invention. Detailed Implementation

[0015] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0016] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments of the invention. The terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0017] In this embodiment of the invention, "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of this invention, "multiple" refers to two or more.

[0018] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0019] All data acquisition in this embodiment is carried out in accordance with laws and regulations and with user consent, and the data is used legally.

[0020] Example 1 This embodiment provides a method for detecting defects in cotter pins of power transmission lines.

[0021] To address the problems of low detection accuracy of cotter pin defects, high false detection rate under high light conditions, and difficulty in balancing accuracy and real-time performance in existing technologies, this invention studies a method for detecting cotter pin defects in transmission lines. For example... Figure 1As shown in the figure, this invention provides a method for detecting cotter pin defects in transmission lines. By using an improved YOLOv8 model, the feature extraction structure, multi-scale feature fusion mechanism, and bounding box regression strategy of the YOLOv8 target detection network are synergistically optimized to achieve high-precision detection of small-sized, weakly textured target defects that are easily affected by lighting. This method is suitable for complex application scenarios such as transmission line inspection.

[0022] As one or more implementation methods, when acquiring images of cotter pin defects in transmission lines, images of cotter pin defects of different defect categories are collected, and the cotter pins and their defect types in the images are labeled. Considering the complex environment of transmission lines, the acquired images are randomly flipped to increase the spatial diversity of the data; the brightness of the images is adjusted to simulate the imaging differences under strong light, shadow, and low light environments; the images are randomly blurred and randomly occluded to simulate motion blur and foreign object occlusion; the processed images are divided into training and testing sets according to a preset ratio to construct a database of cotter pin defect images of transmission lines.

[0023] As one or more implementation methods, target detection is performed based on the acquired image of the transmission line containing cotter pins and a preset target detection model to obtain the target detection result and complete the detection and identification of cotter pin defects.

[0024] In this embodiment, the target detection model used is an improved YOLOv8 model, referred to as the HTE-YOLO model. The HTE-YOLO model improves upon the architecture of the YOLOv8 model by replacing the PANet structure in the YOLOv8 neck network with an enhanced generalized feature pyramid network, and replacing the original C2f module in the neck network with a C2f-HTE module. The C2f-HTE module integrates a hybrid texture enhanced attention mechanism and a multi-scale attention mechanism. In the neck network, a multi-scale power fusion module is set before the enhanced generalized feature pyramid network. In some embodiments, it also includes adding a high-resolution detection layer in the detection head and using a hybrid HPIoU loss function instead of the traditional IoU loss.

[0025] The overall technical approach of this invention is not to simply overlay or adjust the parameters of the existing YOLOv8 model, but to collaboratively optimize multiple core components of the network to address the specific problems faced by the target defect in cotter pin defect detection, thereby significantly improving detection performance while ensuring that the model size and inference speed are controllable.

[0026] Like the YOLOv8 model, the HTE-YOLO model includes a backbone network, a neck network, and a detection head. The improvements made to the HTE-YOLO model compared to the YOLOv8 model are explained in detail below.

[0027] The backbone network adopts a structure similar to the YOLOv8 model. In this embodiment, the backbone network of the HTE-YOLO model includes five feature extraction layers, P1-P5.

[0028] Improvements to the neck network: like Figure 2 As shown, the original PANet structure in the neck network of the YOLOv8 model is replaced with the Enhanced Generalized Feature Pyramid Network (GFPN), and the original C2f module is replaced with the C2f-HTE module. Simultaneously, a Multi-Scale Power Fusion (MSPF) module is set before the Enhanced GFPN in the neck network. The entire neck network processing can be summarized as follows: the input transmission line image is processed by the backbone network to extract five feature maps at different scales (P1-P5, resolution from high to low). The MSPF module performs preliminary dynamic sampling, coordinate attention, and channel shuffling on the P1-P5 feature maps to achieve initial interaction of multi-scale features. The Enhanced GFPN, based on the MSPF output, constructs a more efficient cross-scale feature fusion through upsampling, convolution, and the C2f-HTE module. Finally, the four sets of enhanced feature maps output by the Enhanced GFPN are fed into the detection head to complete target classification and localization.

[0029] The improvements are described in detail below: (1) Replace the original C2f module in the neck network with the C2f-HTE module.

[0030] like Figure 3 and Figure 4 The figures shown are schematic diagrams of the C2f-HTE module and the hybrid texture enhanced attention mechanism (HTE) proposed in this invention.

[0031] The C2f-HTE module first receives the input features and divides them into two parallel processing branches through a segmentation unit: a main enhancement branch and a side branch. The main enhancement branch feeds the features into a Hybrid Texture Enhancement Attention (HTE) mechanism for deep feature extraction and multi-scale attention weighting. The side branch, on the other hand, sequentially performs non-linear mapping of the features using 1×1 convolutions, 3×3 depthwise separable convolutions (DWconv), normalization, and the SiLU activation function, and then adds the residuals using shortened paths to preserve the original structural information to the greatest extent possible. Finally, the processing results from these two branches are channel-aggregated through a connection unit to output the module's final fused features.

[0032] Within the Hybrid Texture Enhancement Attention (HTE) mechanism, the input features are divided into two sub-paths: Spectrum Suppression (HS) and Texture Enhancement (TE). The Spectrum Suppression path utilizes global max pooling and activation functions to extract and generate a spatial weight matrix. Through residual operations of multiplication and addition, it dynamically suppresses specular artifacts while preserving background details. The process involves: performing global max pooling on the input features to extract global information; generating channel weights through activation functions; and multiplying these channel weights element-wise with the input features to suppress the feature responses of metallic reflective areas. The Texture Enhancement path, on the other hand, uses Gaussian blur to filter out high-frequency interference and combines depthwise separable convolution to extract stable local textures, then performing residual addition. The process involves: performing Gaussian smoothing on the input features to eliminate high-frequency noise; and then extracting texture features through depthwise separable convolution. Finally, the enhanced features from these two paths are combined and processed through a convolutional layer to achieve channel-level smoothing and initial fusion.

[0033] The features initially fused by HTE then enter the multi-scale attention mechanism. In this embodiment, the multi-scale attention mechanism is the EMA (Efficient Multi-scale Attention) module. This module divides the features into two paths: a side-path backbone and a multi-branch extractor. The extractor contains three parallel computation branches: a 5×5 separating convolution, a 1×1 depthwise separating convolution, and a regular convolution, used to capture multi-scale spatial and channel information. The outputs of these three branches are concatenated and processed by activation functions to generate a multi-scale attention weight matrix. This matrix is ​​then multiplied and weighted with the side-path backbone features, and the residuals are added again to finally output a high-quality enhanced feature map that takes into account both microscopic texture and macroscopic multi-scale structure.

[0034] The aforementioned C2f-HTE module is a targeted improvement design of the basic feature extraction module C2f in this invention, addressing the problem that small-sized target defects are easily ignored and have insufficient texture information representation in deep networks during the feature extraction stage. Based on the original feature extraction structure, this invention introduces a hybrid texture-enhanced attention mechanism and integrates this attention mechanism with the basic feature extraction unit to form an enhanced feature extraction module. This module processes the input features through a parallel structure, strengthening the weak texture and geometric structure of the target defect region on the one hand, and suppressing abnormal responses caused by metal reflection and high illumination conditions on the other, thereby improving the network's attention to target defects at the feature level. Through this approach, the network can obtain clearer and more stable target defect feature representations at the shallow stage, providing more reliable basic feature information for subsequent multi-scale feature fusion and target detection.

[0035] (2) In the neck network, a multi-scale power fusion module is set before the enhanced generalized feature pyramid network.

[0036] The Multi-Scale Power Fusion Module (MSPF) includes a DySample unit, a Shuffle unit, and an improved CoorAtt unit, with the specific structure as follows: Figure 5 , Figure 6 (a)- Figure 6 As shown in (b).

[0037] The specific processing procedure of the Multi-Scale Power Fusion Module (MSPF) is as follows: The input feature map P1 is processed by an improved CoorAtt unit to learn the importance of positional information in the feature map, resulting in an enhanced P1 feature map. Feature maps P2 and P5 are processed by a DySample unit, resulting in enhanced P2 and P5 feature maps, respectively. The DySample unit, targeting the small scale and edge-dominated characteristics of the pin opening, achieves adaptive feature recovery through weighted fusion of multiple upsampling kernels, preserving the integrity of circular features better than traditional interpolation methods. The P3 feature map is processed by a Shuffle unit, resulting in an enhanced P3 feature map. The Shuffle unit enhances the network's ability to represent the diversity of local features.

[0038] The improved CoorAtt unit specifically processes the following steps: Global average pooling is performed on the input features in both the horizontal and vertical directions to generate horizontal and vertical attention features; a radial weight term is introduced to weight the ring response in the approximate centered region. This radial weight term is obtained by performing polar coordinate transformation or radial feature extraction on the input features, followed by 1×1 convolution and ReLU activation; the horizontal and vertical attention features, along with the radial weight term, are fused to generate a final attention map containing spatial location information and radial geometric information; the final attention map is multiplied by the original input features to obtain an enhanced feature map, thereby strengthening the integrity and continuity of the pin hole edge.

[0039] Through the synergistic optimization of the above three units, the feature alignment and fusion quality are significantly improved while maintaining lightweight design. The fusion weights of features at different scales can be adaptively adjusted, enabling the network to dynamically allocate feature contribution ratios for small-sized, weak-edge targets such as cotter pins, thereby significantly improving the detection stability and accuracy of small-sized target defects.

[0040] (3) Replace the original PANet structure in the neck network of the YOLOv8 model with the enhanced generalized feature pyramid network GFPN.

[0041] The specific processing procedure of the Enhanced Generalized Feature Pyramid Network (GFPN) is as follows: The P5 feature map extracted from the backbone network is dynamically upsampled by the DySample unit in the multi-scale power fusion module MSPF, and then concatenated with the P3 feature map processed by the Shuffle unit. The concatenated feature map is then fed into the first C2f-HTE module to extract deep enhancement features. The output features of this module are fused with the P2 enhancement features through the upsampling operator (Up), and then concatenated with the P4 features again for cross-scale concatenation after convolution. Subsequently, the feature stream is fed back into the C2f-HTE module for multi-scale texture enhancement, and finally converged with the attention mechanism enhancement features from the P1 layer to form a complete feature pyramid covering targets from very small to large. Finally, the Enhanced Generalized Feature Pyramid Network (GFPN) outputs four sets of scale-aligned and feature-complete enhanced feature maps, which are fed into the four detection layers of the detection head to achieve accurate coverage of cotter pin defects of different sizes.

[0042] The aforementioned improvements to the neck network structure primarily address the issue of large scale variations and small target proportions in inspection images due to target defects. By introducing a multi-scale power fusion module into the generalized feature pyramid network, feature information from different scales can be fully complementary during the fusion process. This multi-scale power fusion module not only preserves spatial details in shallow features but also enhances the semantic expressiveness of deep features, effectively mitigating the problem of shallow information being masked by deep semantics during traditional feature fusion.

[0043] Improvements to the detection head: To fully utilize high-resolution feature information, this embodiment adds an additional detection layer to the detection head network. The standard YOLOv8 model's detection part typically contains only three detection layers of different scales, corresponding to large, medium, and small targets, respectively. However, after multiple convolutions and downsampling in the deeper layers of the network, the geometric details and spatial information of extremely small holes (such as cotter pins) are easily lost in the deep feature maps. Figure 2 As shown, to address the aforementioned issues, this invention introduces a new branch from the shallow feature map following the P1 feature extraction layer, adding a fourth detection layer specifically for handling extremely small targets. In other words, the `detect` part comprises four detection layers. This improvement enables the network to detect target defects at a finer spatial scale, thereby further enhancing its ability to perceive small targets.

[0044] After completing the entire model construction, the HTE-YOLO model was trained using the constructed image database of cotter pin defects in transmission lines. During training, a hybrid HPIoU loss function was used instead of the traditional IoU loss, with the specific formula as follows:

[0045] in, =0.5, which is the balance coefficient. The brightness weights are dynamically calculated during training.

[0046] The loss function consists of a weighted sum of the PIoU base term, the WIoU dynamic term, and a brightness-weighted Inner-IoU term. The PIoU term is a corner penalty mechanism that introduces the Euclidean distance between the corners of the predicted and ground truth boxes as a penalty, directly penalizing shape deviations and suitable for irregular contours. The WIoU term is a dynamic attention strategy that includes a dynamic non-monotonic focusing mechanism based on anchor box quality, dynamically allocating gradient gain according to the overlap of the predicted boxes, causing the model to focus on medium-quality anchor boxes. The brightness-weighted Inner-IoU term addresses metallic specular interference, increasing the penalty in high-brightness regions to force the model to compensate for reflection offsets. Multiple rounds of iterative training are performed by setting appropriate training parameters, such as the SGD optimizer and cosine annealing learning rate strategy, until the model converges.

[0047] The calculation method for the brightness-weighted Inner-IoU term includes: calculating the average brightness value within the predicted bounding box region; calculating the brightness weight based on the average brightness value, where the brightness weight increases with the increase of the brightness value when the average brightness value is greater than the preset highlight threshold; calculating the intersection-union ratio (IU) of the inscribed rectangles of the predicted bounding box and the ground truth bounding box; calculating the difference between "1 minus the IU of the inscribed rectangles", and multiplying this difference by the brightness weight to obtain the final brightness-weighted loss value, thereby forcing the model to compensate for the positional shift caused by metallic reflection.

[0048] This invention addresses the insufficient localization accuracy of existing bounding box regression methods under conditions of high light interference and weak boundaries by improving the design of the bounding box regression loss function. This invention proposes a hybrid bounding box regression optimization strategy, which combines multiple regression constraint mechanisms to enable the regression process to pay more attention to the geometric features and boundary consistency of the target defect. During the regression process, the corner relationship between the predicted and ground truth bounding boxes is constrained to improve the fitting ability of the target contour; simultaneously, a dynamic weight adjustment mechanism is introduced to make the network pay more attention to sample regions with high optimization potential during training. Furthermore, to address the problem of high light reflection easily generated by metal components under strong lighting conditions, this invention introduces a brightness-aware mechanism during the regression optimization process to apply targeted constraints to bright areas, thereby reducing the offset caused by high light on boundary localization and enabling the target defect to maintain stable and accurate localization results even in complex lighting environments.

[0049] Through the synergistic optimization of the above feature extraction, multi-scale fusion and regression strategies, this invention constructs the HTE-YOLO model, which can significantly improve the detection accuracy and robustness of cotter pin defects that are small in size, weak in texture and susceptible to light interference, while ensuring real-time detection performance.

[0050] Experimental results A pre-trained HTE-YOLO model was used to predict cotter pin defects in transmission lines. A comparison with other commonly used detection models for cotter pin defect detection is shown in Table 1.

[0051] Table 1. Experimental Comparison Chart

[0052] Experiments show that, compared with other commonly used detection models for cotter pin defects, the method proposed in this invention can significantly improve the accuracy and recall rate of cotter pin defect detection under complex backgrounds and strong reflective conditions, meeting the real-time requirements of industrial inspection.

[0053] Example 2 This embodiment provides a defect detection system for cotter pins in transmission lines, including: An acquisition module is configured to acquire images of transmission lines containing cotter pins; The detection module is configured to perform target detection based on the acquired image of the transmission line containing cotter pins and a preset target detection model, obtain the target detection result, and complete the detection and identification of cotter pin defects. The preset target detection model adopts an improved YOLOv8 model, including a backbone network, a neck network, and a detection head. The PANet structure in the YOLOv8 neck network is replaced by an enhanced generalized feature pyramid network, and the original C2f module in the neck network is replaced by a C2f-HTE module. The C2f-HTE module integrates a hybrid texture enhanced attention mechanism and a multi-scale attention mechanism. A multi-scale power fusion module is set in the neck network before the enhanced generalized feature pyramid network.

[0054] The detailed steps are the same as those provided in Example 1 for detecting defects in cotter pins of transmission lines, and will not be repeated here.

[0055] The descriptions of each embodiment in the above embodiments have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0056] The proposed system can be implemented in other ways. For example, the system embodiments described above are merely illustrative, and the division of modules described above is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed.

[0057] Example 3 This embodiment of the invention provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein, the processor is connected to the memory, and the one or more computer programs are stored in the memory. When the electronic device is running, the processor executes the one or more computer programs stored in the memory to cause the electronic device to perform the method described in Embodiment 1 above.

[0058] It should be understood that in this embodiment, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0059] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of memory may also include non-volatile random access memory. For example, memory may also store information about the device type.

[0060] In the implementation process, each step of the above method can be completed by the integrated logic circuits in the processor hardware or by software instructions.

[0061] The method in Embodiment 1 can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can reside in readily available storage media in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not provided here.

[0062] Those skilled in the art will recognize that the units and algorithm steps described in connection with the various examples of this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.

[0063] Example 4 Embodiment 4 of the present invention provides a computer-readable storage medium.

[0064] A computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the steps of the method as described in Embodiment 1 of the present invention.

[0065] The detailed steps are the same as those provided in Example 1, and will not be repeated here.

[0066] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for detecting defects in cotter pins of transmission lines, characterized in that, include: Obtain images of transmission lines containing cotter pins; Based on the acquired image of the transmission line containing cotter pins and the preset target detection model, target detection is performed to obtain the target detection results and complete the detection and identification of cotter pin defects. The preset target detection model adopts an improved YOLOv8 model, including a backbone network, a neck network, and a detection head. The PANet structure in the YOLOv8 neck network is replaced by an enhanced generalized feature pyramid network, and the original C2f module in the neck network is replaced by a C2f-HTE module. The C2f-HTE module integrates a hybrid texture enhanced attention mechanism and a multi-scale attention mechanism. A multi-scale power fusion module is set in the neck network before the enhanced generalized feature pyramid network.

2. The detection method for cotter pin defects in transmission lines as described in claim 1, characterized in that, The backbone network of the preset target detection model includes five feature extraction layers, P1-P5, and a branch is drawn from the shallow feature map after the P1 feature extraction layer to add a detection layer.

3. The detection method for cotter pin defects in transmission lines as described in claim 1, characterized in that, When training the target detection model, a hybrid HPIoU loss function is used, which is composed of a weighted sum of the PioU base term, the WIoU dynamic term, and the brightness-weighted Inner-IoU term.

4. The detection method for cotter pin defects in transmission lines as described in claim 3, characterized in that, The calculation method for the brightness-weighted Inner-IoU term is as follows: Calculate the average brightness value within the prediction box area; The brightness weight is calculated based on the average brightness value. When the average brightness value is greater than the preset highlight threshold, the brightness weight increases as the brightness value increases. Calculate the intersection-union ratio (IUU) of the inscribed rectangles of the predicted bounding box and the ground truth bounding box; calculate the difference between 1 and the IUU of the inscribed rectangles, and multiply this difference by the brightness weight to obtain the final brightness-weighted loss value.

5. The detection method for cotter pin defects in transmission lines as described in claim 1, characterized in that, The specific working process of the C2f-HTE module is as follows: The input features are divided into two paths. The first path serves as a side branch to preserve the original structural information, while the second path is input into the hybrid texture enhanced attention mechanism. The hybrid texture enhancement attention mechanism is further divided into two complementary branches: a texture enhancement branch and a specular suppression branch; The output features of the texture enhancement branch and the output features of the specular suppression branch are concatenated, and the concatenated features are fed into a multi-scale attention mechanism to generate weights through parallel multi-scale convolution. Finally, the enhanced features are residually connected with the bypass branches to form the output of the C2f-HTE module.

6. The detection method for cotter pin defects in transmission lines as described in claim 1, characterized in that, The multi-scale power fusion module includes a Shuffle unit, a DySample unit, and an improved CoorAtt unit.

7. The method for detecting defects in cotter pins of transmission lines as described in claim 6, characterized in that, The specific working process of the improved CoorAtt unit is as follows: Global average pooling is performed on the input features in the horizontal and vertical directions respectively to generate horizontal attention features and vertical attention features; A radial weight term is introduced to weight the ring response of the approximate circular center region. The radial weight term is obtained by performing polar coordinate transformation or radial feature extraction on the input features, followed by convolution and activation function processing. The horizontal attention features, vertical attention features, and radial weights are fused to generate a final attention map that includes spatial location information and radial geometric information. The final attention map is multiplied by the original input features to obtain the enhanced feature map.

8. A detection system for cotter pin defects in transmission lines, characterized in that, include: An acquisition module is configured to acquire images of transmission lines containing cotter pins; The detection module is configured to perform target detection based on the acquired image of the transmission line containing cotter pins and a preset target detection model, obtain the target detection result, and complete the detection and identification of cotter pin defects. The preset target detection model adopts an improved YOLOv8 model, including a backbone network, a neck network, and a detection head. The PANet structure in the YOLOv8 neck network is replaced by an enhanced generalized feature pyramid network, and the original C2f module in the neck network is replaced by a C2f-HTE module. The C2f-HTE module integrates a hybrid texture enhanced attention mechanism and a multi-scale attention mechanism. A multi-scale power fusion module is set in the neck network before the enhanced generalized feature pyramid network.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the program, it implements the steps in the method for detecting cotter pin defects in transmission lines as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the method for detecting cotter pin defects in transmission lines as described in any one of claims 1-7.