A method and system for detecting defects in a transmission line

By adopting a target detection network based on cross-over attention and integrated learning in drone inspection, combining CBAM attention mechanism and multi-scale feature fusion, the accuracy problems of high-resolution image processing and small object recognition are solved, and the detection effect of complex defects is improved through the packet balance network and two-stage detection method, and more efficient and accurate transmission line defect detection is achieved.

CN119477903BActive Publication Date: 2025-04-04UNIV OF SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510052895.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2025-04-04
Estimated Expiration
2045-01-14

AI Technical Summary

Technical Problem

In existing drone inspections, high-resolution image processing and analysis rely on manual recognition, resulting in slow processing speed and low accuracy; the target detection network loses detailed information due to scaling when processing high-resolution images, affecting the accuracy of small target recognition; the defect data distribution presents long-tail features, resulting in poor tail detection effect; the single target detection network performs poorly when identifying complex defects, making it difficult to ensure the comprehensiveness and accuracy of detection.

Method used

A target detection network based on cross-cross attention and integrated learning is proposed. Through the Res-CCA module, the improved backbone module and the shared detection head module, combined with the CBAM attention mechanism and multi-scale feature fusion, the model's processing ability and small object recognition accuracy of high-resolution images are improved; a group balance network based on integrated learning is designed, and the sample weight is dynamically adjusted to solve the problem of category imbalance; a two-stage defect detection method is adopted, and the target detection network is first used to identify the subject part, and then the classification network is used for secondary classification to improve the accuracy and robustness of the detection.

Benefits of technology

By retaining image details and reducing network computing, the detection effect of high-resolution image processing is improved, especially in small target recognition and complex backgrounds; the problem of category imbalance is effectively solved, and the detection accuracy of a few types of defects is improved; more efficient and accurate detection of transmission line defects is achieved, and the intelligence and digitalization of patrols are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119477903B_ABST
    Figure CN119477903B_ABST
Patent Text Reader

Abstract

The present invention proposes a method and system for detecting defects in power transmission lines, which belongs to the field of target detection, and includes: S1: establishing an initial data set; grouping the initial data set to construct a target detection training set; cutting defective targets that are difficult to identify in the initial data set to construct a classification training set; step S2: constructing a target detection network based on cross attention and ensemble learning, and training it using the target detection training set; step S3: inputting the classification training set into the classification network for training; S4: inputting the image to be detected into the trained target detection network based on cross attention and ensemble learning to obtain the detection result of each branch network; screening the detection results that need secondary classification and inputting them into the trained classification network for further classification to obtain the final detection result. The method of the present invention improves the accuracy and robustness of target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of target detection, and in particular relates to a method and system for detecting defects in a power transmission line. Background Art

[0002] With the rapid development of intelligent technology, drone inspection has gradually replaced traditional inefficient manual inspection and become an advanced method for transmission line defect detection. Drone inspection records the status of equipment such as poles and towers through high-resolution images, and can conduct comprehensive and detailed monitoring and analysis of the health status of power equipment. Compared with manual inspection, drones can easily cover a wide area, significantly improve inspection efficiency, and reduce manpower input. However, the processing and analysis of a large number of high-resolution images taken by drones currently mainly rely on manual recognition, which has the problems of slow processing speed and low accuracy. On the one hand, the process of manual recognition is time-consuming, and it is difficult to meet the requirements of real-time analysis when the amount of data is huge; on the other hand, due to the interference of human factors, the accuracy of manual recognition is difficult to guarantee, and it is easy to miss and misdetect, which in turn affects the reliability of the detection results. Therefore, in order to meet the application needs of drone inspection, there is an urgent need for a method that can efficiently and accurately process and analyze data, so as to quickly and accurately identify and locate defects and hidden dangers on the transmission line, thereby improving the intelligence and digitalization level of transmission line inspection.

[0003] At present, existing defect detection tasks usually rely on target detection methods to achieve this. Such methods have certain advantages in recognition efficiency and accuracy, but they still have many limitations in processing high-resolution images of drone inspections. In order to reduce the amount of network calculations, existing target detection networks usually set the size of the input image to be relatively small to save resources and increase processing speed. However, the high-resolution images taken by drones are often tens or even hundreds of times the input size of the detection network. If they are directly scaled to the appropriate size and input into the network, a lot of detail information in the image will be lost. This information loss has a particularly significant impact on small targets, especially for those defective targets that account for a very small proportion of the image and have relatively inconspicuous features. Scaling processing will greatly reduce the accuracy of detection, making the network face greater challenges in small target detection. Therefore, how to efficiently input and process high-resolution images while retaining image details has become an important issue in improving the accuracy of drone inspections.

[0004] In addition, the defect data of distribution lines presents a long-tail distribution feature in actual scenarios, that is, the data volume of a few types of defects is large, while the data volume of most categories is small. For example, the common 20% mainstream defect categories account for 80% of the data volume, while the data volume of the tail categories is very scarce. This uneven distribution will cause the network to tend to the head categories with large data volumes during training and inference, and it is easy to ignore the tail defect data, resulting in poor detection of the tail categories. Although traditional methods such as re-sampling and re-weighting can improve this problem to a certain extent by increasing the weight of the tail category data to make the model pay attention to these categories, this may also cause the network to overfit on the tail data, which in turn reduces the generalization ability of the model and affects the overall detection effect. Therefore, the long-tail distribution problem is still an important challenge in drone inspection defect detection.

[0005] Finally, the task of defect detection in distribution lines also faces problems such as insufficiently obvious defect features and high similarity between different defects. For example, the features of some fine cracks or slight rust are not obvious under different light and angles, while some defects may show highly similar appearance features and even be difficult to distinguish from the surrounding environment in scenes with complex backgrounds. In this case, traditional single target detection networks often perform poorly in identifying and distinguishing these complex defects, making it difficult to ensure the comprehensiveness and accuracy of detection.

[0006] In summary, the prior art has the following defects:

[0007] 1. In current drone inspection tasks, the processing and analysis of a large number of high-resolution images mainly rely on manual recognition, which not only leads to a lower processing speed, but also causes insufficient accuracy due to the limitations of manual recognition, and often results in missed detections and false detections.

[0008] 2. Existing target detection algorithms usually use a smaller input size to reduce the computational burden. However, this strategy will lead to the loss of a lot of detail information when processing high-resolution images taken by drones, especially affecting the accuracy of small target recognition.

[0009] 3. The distribution of defect data shows a significant long-tail feature, and the amount of defect data of different categories varies greatly. In this context, the recognition effect of tail categories with less data is poor, and it is difficult to meet the detection needs of different defect types.

[0010] 4. Single target detection algorithms have certain limitations when identifying various types of defects, especially when the features are not obvious or the features between different defects are highly similar, it is difficult to achieve high-accuracy recognition.

[0011] Therefore, in the detection of distribution line defects, relying solely on a single target detection network is difficult to meet the needs. More complex detection strategies are urgently needed to cope with the complexity of different defect characteristics and further improve the accuracy and robustness of detection. Summary of the invention

[0012] In order to solve the above technical problems, the present invention provides a method for detecting defects in a power transmission line, comprising the following steps:

[0013] Step S1: Acquire multi-angle drone aerial images of different power transmission lines to establish an initial data set; group the initial data set to construct a target detection training set; crop the defective targets that are difficult to identify in the initial data set to construct a classification training set;

[0014] Step S2: constructing a target detection network based on cross attention and ensemble learning, the network comprising: a Res-CCA module, an improved backbone module and a shared detection head module; inputting the target detection training set into the target detection network based on cross attention and ensemble learning for training;

[0015] Step S3: input the classification training set into the classification network for training;

[0016] Step S4: Input the image to be detected into the trained target detection network based on cross attention and ensemble learning to obtain the detection results of each branch network; filter the detection results that need secondary classification and input them into the trained classification network for further classification to obtain the final detection results.

[0017] Beneficial effects:

[0018] 1. This paper proposes a data preprocessing method based on position encoding and cross attention. This method effectively extracts and maps features of images, ensures that key details are retained while reducing network calculations, and avoids the problem of affecting detection accuracy due to direct scaling. Through this method, the model can better maintain the detection effect when processing high-resolution images, improve the overall performance, and avoid directly scaling the input high-resolution images, which reduces the performance of the subsequent target detection network.

[0019] 2. In the prior art, the obtained feature map is directly input into the target detection network for detection, but there is a problem of poor effect in detecting small targets. To address this problem, the present invention improves the existing YOLOv8 algorithm by introducing the CBAM attention mechanism into the backbone network and fusing the P2 layer with high-resolution features with the P3, P4, and P5 layers to output multi-scale features more effectively from aerial images, especially for scenes with complex backgrounds. Through this mechanism, the model can adaptively focus on key areas in the image and reduce the interference of background noise on the detection results, thereby improving the detection accuracy and generalization ability of the model, especially for the recognition of small targets.

[0020] 3. In order to solve the detection bias caused by category imbalance, the present invention designs a group balancing network based on ensemble learning to dynamically adjust the weights of different samples. This method analyzes the target data volume of samples of different categories, divides the samples into multiple groups, and keeps the number of samples in each group balanced. By dynamically adjusting the weights of samples in different groups, the detection bias problem caused by category imbalance is effectively solved. This framework can enhance the robustness of the model when processing minority class samples and improve the detection accuracy of minority class defects, thereby improving the adaptability and detection effect of the overall model.

[0021] 4. The present invention also provides a two-stage defect detection method that combines subject detection and classification. First, a target detection network is used to identify the main body parts in the image where defects may occur, and then the classification network is used to determine whether the main body parts have defects after being cut out, thereby achieving more efficient and universal distribution line defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A schematic diagram of a method for detecting defects in a power transmission line according to the present invention;

[0023] Figure 2 A schematic diagram of the structure of the target detection network based on cross attention and ensemble learning;

[0024] Figure 3 It is a schematic diagram of the structure of the Res-CCA module;

[0025] Figure 4 It is a cross attention module;

[0026] Figure 5 This is a schematic diagram of the structure of the improved backbone module;

[0027] Figure 6 The present invention is a schematic diagram of a process of performing image detection using a power transmission line defect detection method of the present invention. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0029] Embodiment 1

[0030] like Figure 1 As shown, a method for detecting defects in a power transmission line provided by an embodiment of the present invention comprises the following steps:

[0031] Step S1: Acquire multi-angle drone aerial images of different power transmission lines to establish an initial data set; group the initial data set to construct a target detection training set; crop the defective targets that are difficult to identify in the initial data set to construct a classification training set;

[0032] Step S2: constructing a target detection network based on cross attention and ensemble learning, the network comprising: a Res-CCA module, an improved backbone module and a shared detection head module; inputting the target detection training set into the target detection network based on cross attention and ensemble learning for training;

[0033] Step S3: input the classification training set into the classification network for training;

[0034] Step S4: Input the image to be detected into the trained target detection network based on cross attention and ensemble learning to obtain the detection results of each branch network; filter the detection results that need secondary classification and input them into the trained classification network for further classification to obtain the final detection results.

[0035] In one embodiment, the above step S1: acquiring multi-angle drone aerial images of different power transmission lines to establish an initial data set; grouping the initial data set to construct a target detection training set; cropping defective targets that are difficult to identify in the initial data set to construct a classification training set, specifically includes:

[0036] Step S11: Obtain multi-angle drone images of different distribution lines and towers; mark the defective parts or subjects in the images, and mark the position information of the mark boxes. Store and form an initial data set; wherein, for defect categories that are relatively difficult to identify, the main parts of the locations are marked, and secondary annotations of "normal" and "abnormal" are added;

[0037] Among them, for defects that are easy to identify, the defect parts can be directly marked, and the target detection network can be used to directly detect the defects later; for defect categories that are relatively difficult to identify, the main parts are marked for subsequent target detection network training, and the secondary marking is used for subsequent classification network training;

[0038] Step S12: Count the number of samples of each defect category in the initial data set and sort them according to the number; group them according to the number of defect categories, and divide samples with similar numbers of defects into one group to obtain a large sample group, a small sample group, and a rare sample group; process the grouped images, and if a certain image contains a defect category that does not belong to the group, set it to other categories to obtain a target detection training set;

[0039] For example, if the number of samples of defect categories A, B, and C is similar and large, they are grouped into the "large sample group". Defect categories D and E have fewer samples and are grouped into the "small sample group", while categories F and G, which have even fewer samples, are grouped into the "rare sample group". If a defect category that does not belong to the group exists in a certain image after grouping, it is set to other categories.

[0040] Step S13: Cut out a single defect or a main body according to the position information of the annotation box and save it into a folder with the corresponding category name, and perform image enhancement by using hue change, random noise, and random mosaic methods to expand a smaller number of category images and obtain a classification training set.

[0041] In one embodiment, the above step S2: constructing a target detection network based on cross attention and ensemble learning, the network comprising: a Res-CCA module, an improved backbone module and a shared detection head module; inputting the target detection training set into the target detection network based on cross attention and ensemble learning for training, specifically comprising:

[0042] Step S21: Input the target detection training set based on ensemble learning into the target detection network based on cross attention and ensemble learning in groups. First, each group of target detection training sets enters each corresponding Res-CCA module, and the image size is reduced by a large convolution kernel and a pooling operation. Then, the original information is retained through a residual connection, and the cross attention module interacts with information in the horizontal and vertical directions to generate a feature map with global attention.

[0043] like Figure 2 As shown in FIG. 1 , it is a schematic diagram of the structure of the target detection network based on cross attention and ensemble learning. In the embodiment of the present invention, the target detection training set is divided into three groups and respectively input into the three branches of the network. First, each group of samples enters the Res-CCA module for data preprocessing, such as Figure 3The structure of the Res-CCA module is shown in Figure 2. The structure of the Criss-Cross Attention module is shown in Figure 2. Figure 4 As shown in the figure, the cross attention module consists of multiple attention heads, each of which is responsible for a different feature subspace, allowing the model to capture image features from multiple angles. Each attention head independently calculates the cross attention, and then splices the output results of each head to generate a more discernible feature representation. This multi-head design enables the network to pay attention to more details when extracting target features, enhances the ability to distinguish targets of different categories, and significantly improves the detection effect, especially when processing multi-scale features. The cross attention module specifically includes:

[0044] Step S211: The input feature map is divided into several patches of the same size, and each patch is transformed by different linear transformations to obtain Q, K, and V matrices. These linear transformations are transformed by different weight matrices. , , accomplish;

[0045] Step S212: For each Attention is calculated in the horizontal and vertical directions. The attention calculation formula is:

[0046] ;

[0047] ;

[0048] in, is the scaling factor;

[0049] Step S213: Perform weighted summation on the attention results in the horizontal and vertical directions to generate an updated feature representation. The calculation formula is as follows:

[0050] ;

[0051] Step S214: The residual connection is performed with patch, and the final output feature can be expressed as:

[0052] ;

[0053] Step S215: Repeat step S214 to achieve global receptive field coverage through two cross-attention mechanisms.

[0054] Step S22: Based on the backbone of YOLOv8, an improved backbone module is constructed, including: multiple convolutional layers, pooling layers and residual modules to extract multi-scale features of feature maps with global attention, and a CBAM attention mechanism is added on the basis of the original backbone to adapt to the needs of small target detection and complex background processing. Through the attention mechanism in the two dimensions of channel and space, the expression ability of the feature map is improved, important features are highlighted, irrelevant information is suppressed, and the effect of target detection is improved; finally, the feature maps of the last 4 layers are output, that is, the P2 layer with high-resolution features is fused with the P3, P4, and P5 layers for output. These feature maps retain different feature information from coarse-grained to fine-grained, which are used for subsequent detection tasks to ensure that the target detection network can make accurate predictions for targets of different sizes.

[0055] Figure 5 This is a schematic diagram of the structure of the improved backbone module of the present invention.

[0056] Step S23: Input the four feature maps into the shared detection head built based on the Transformer structure. Through the global self-attention mechanism, a direct dependency relationship is established between each position of the feature map, and the context information of each target is comprehensively considered, so as to directly output the precise position and category of the target in the prediction process;

[0057] In an embodiment of the present invention, a Transformer structure is selected as the shared detection head of the network. Traditional target detection methods usually rely on the NMS operation to remove redundant detection boxes and filter out the best detection results. However, the NMS operation itself is computationally intensive and takes a long time to process, especially in a multi-branch network, where each branch needs to perform an NMS operation independently, which results in extremely high time overhead. After the Transformer structure is introduced, the detection head no longer relies on the NMS operation, significantly reducing the computational overhead and ensuring efficient real-time detection.

[0058] Step S24: Calibrate the classification boundaries of the classification results in different groups respectively:

[0059] ;

[0060] ;

[0061] in, is the predicted classification result, and are the learnable parameters of the network, It is the result of normalizing the weights of the shared detection head;

[0062] Step S25: Calculate regression loss , confidence loss and classification loss , and update the parameters of the target detection network based on cross attention and ensemble learning according to the calculated loss;

[0063] Regression Loss The IoU loss is used, and the calculation formula is:

[0064] ;

[0065] in, is the predicted detection box, is the real labeled detection box;

[0066] Confidence loss The cross entropy loss is used, and the calculation formula is:

[0067] ;

[0068] in, is the confidence of the prediction result, is the confidence of the true annotation, which is 1;

[0069] Classification Loss The EQL loss is used, and the calculation formula is:

[0070] ;

[0071] ;

[0072] ;

[0073] in, is the predicted classification result, is the classification result of the real annotation, Indicates category The frequency of occurrence in the dataset, is a pre-set category frequency threshold; is a classification function; is the focal loss function;

[0074] Step S26: Repeat steps S21 to S25 until the loss converges to the minimum value and no longer decreases, completing the training of the target detection network based on cross attention and ensemble learning.

[0075] In one embodiment, the above step S3: inputting the classification training set into the classification network for training;

[0076] The present invention does not limit the classification network, and any existing classification network can be trained using the classification training set.

[0077] In one embodiment, the above step S4: inputting the image to be detected into the trained target detection network based on cross attention and ensemble learning to obtain the detection result of each branch network; screening the detection results that need secondary classification and inputting them into the trained classification network for further classification to obtain the final detection result, specifically includes:

[0078] Step S41: input the image to be detected into the trained object detection network based on cross attention and ensemble learning to obtain the detection result of each branch network;

[0079] Step S42: Map the detection results of all branch networks back to the image to be detected, remove all detection results of other categories, and use NMS non-maximum suppression to filter redundant detection results; finally, filter the detection results that need secondary classification;

[0080] Step S43: Cut out the defective target from the corresponding image according to the position information of the detection result of the secondary classification required, and then send it to the trained classification network to obtain further classification results and update the category of the detection result. as the final test result.

[0081] like Figure 6 As shown in the figure, the image to be detected is input into the three branches of the object detection network based on cross attention and ensemble learning, and two detection results are obtained: the safety pin at the top of the image and the bird's nest at the bottom. Among them, the bird's nest is an easily identifiable defect target and can be directly used as the detection result. However, it is difficult to identify whether the safety pin is a defect target, so it is necessary to cut the safety pin and put it into the classification network for secondary classification to determine whether it is a defect target.

[0082] Embodiment 2

[0083] The embodiment of the present invention provides a power transmission line defect detection system, comprising the following modules:

[0084] Construct a training set module to obtain multi-angle drone aerial images of different power transmission lines to establish an initial data set; group the initial data set to construct a target detection training set; crop defective targets that are difficult to identify in the initial data set to construct a classification training set;

[0085] Constructing and training a target network module for constructing a target detection network based on cross attention and ensemble learning, the network comprising: a Res-CCA module, an improved backbone module and a shared detection head module; inputting the target detection training set into the target detection network based on cross attention and ensemble learning for training;

[0086] Training a classification network module, inputting the classification training set into the classification network for training;

[0087] The detection module is used to input the image to be detected into the trained target detection network based on cross attention and ensemble learning to obtain the detection results of each branch network; filter the detection results that need secondary classification and input them into the trained classification network for further classification to obtain the final detection results.

[0088] A power transmission line defect detection device comprises one or more electronic devices, wherein the one or more electronic devices are used to implement a power transmission line defect detection method, system and device.

[0089] An electronic device includes: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement a transmission line defect detection method, system and device.

[0090] A computer-readable storage medium stores executable instructions, which, when executed by a processor, enable the processor to implement a method, system and device for detecting defects in a power transmission line.

[0091] A non-transitory computer-readable storage medium stores a computer program, which, when executed by a processor, implements a method, system and device for detecting defects in a power transmission line.

Claims

1. A method for detecting defects in a power transmission line, characterized in that: include: Step S1: Acquire multi-angle drone aerial images of different power transmission lines to establish an initial data set; The initial data set is grouped to construct a target detection training set; Cutting out defect targets that are difficult to identify in the initial data set to construct a classification training set; Step S2: constructing a target detection network based on cross attention and ensemble learning, the network comprising: a Res-CCA module, an improved backbone module and a shared detection head module; inputting the target detection training set into the target detection network based on cross attention and ensemble learning for training; Step S3: inputting the classification training set into the classification network for training; Step S4: Input the image to be detected into the trained target detection network based on cross attention and ensemble learning to obtain the detection results of each branch network; filter the detection results that need secondary classification and input them into the trained classification network for further classification to obtain the final detection results.

2. The method for detecting defects in a power transmission line according to claim 1, characterized in that: The step S1: acquiring multi-angle drone aerial images of different power transmission lines to establish an initial data set; The initial data set is grouped to construct a target detection training set; The defect targets that are difficult to identify in the initial data set are trimmed to construct a classification training set, which specifically includes: Step S11: Obtain multi-angle drone images of different distribution lines and towers; mark the defective parts or subjects in the images, and mark the position information of the mark boxes. Store and form an initial data set; in which, for defect categories that are relatively difficult to identify, the main parts of the locations are marked, and secondary annotations of "normal" and "abnormal" are added; Step S12: Count the number of samples of each defect category in the initial data set and sort them according to the number; group them according to the number of defect categories, and divide samples with similar numbers of defects into one group to obtain a large sample group, a small sample group, and a rare sample group; process the grouped images, and if a certain image contains a defect category that does not belong to the above groupings, set it to other categories to obtain a target detection training set; Step S13: Cut out a single defect or a main body according to the position information of the annotation box and save it into a folder with a corresponding category name, and perform image enhancement by using hue change, random noise, and random mosaic methods to expand a smaller number of category images and obtain a classification training set.

3. The method for detecting defects in a power transmission line according to claim 2, characterized in that: The step S2: constructing a target detection network based on cross attention and ensemble learning, the network comprising: a Res-CCA module, an improved backbone module and a shared detection head module; inputting the target detection training set into the target detection network based on cross attention and ensemble learning for training, specifically comprising: Step S21: The target detection training set is grouped and input into the target detection network based on cross attention and ensemble learning. First, each group of target detection training sets enters each corresponding Res-CCA module, and the image size is reduced by a large convolution kernel and a pooling operation. Then, the original information is retained through a residual connection, and the cross attention module interacts with information in the horizontal and vertical directions to generate a feature map with global attention. Step S22: Based on the backbone of YOLOv8, an improved backbone module is constructed, including: multiple convolutional layers, pooling layers and residual modules, to extract multi-scale features of the feature map with global attention, and a CBAM attention mechanism is added on the basis of the original backbone to improve the expression ability of the feature map through the attention mechanism in the two dimensions of channel and space; finally, the feature map of the last 4 layers is output; Step S23: inputting the four feature maps into a shared detection head built based on the Transformer structure, establishing a direct dependency relationship between each position of the feature map through a global self-attention mechanism, and comprehensively considering the context information of each target, so as to directly output the precise position and category of the target in the prediction process; Step S24: Calibrate the classification boundaries of the classification results in different groups respectively: ; ; in, is the predicted classification result, and are the learnable parameters of the network, is the result of normalizing the weight of the shared detection head; Step S25: Calculate regression loss , confidence loss and classification loss , and update the parameters of the target detection network based on cross attention and ensemble learning according to the calculated loss; Regression Loss The IoU loss is used, and the calculation formula is: ; in, is the predicted detection box, is the real labeled detection box; Confidence loss The cross entropy loss is used, and the calculation formula is: ; in, is the confidence of the prediction result, is the confidence of the true annotation, which is 1; Classification Loss The EQL loss is used, and the calculation formula is: ; ; ; in, is the predicted classification result, is the classification result of the real annotation, Indicates category The frequency of occurrence in the data set, is a pre-set category frequency threshold; is a classification function; is the focal loss function; Step S26: Repeat steps S21 to S25 until the loss converges to a minimum value and no longer decreases, completing the training of the target detection network based on cross attention and ensemble learning.

4. The method for detecting defects in a power transmission line according to claim 3, characterized in that: The cross attention mechanism of step S21 specifically includes: Step S211: The input feature map is divided into several patches of the same size, and each patch is transformed by different linear transformations to obtain Q, K, and V matrices. These linear transformations are transformed by different weight matrices. , , accomplish; Step S212: For each Attention is calculated in the horizontal and vertical directions. The attention calculation formula is: ; ; in, is the scaling factor; Step S213: Perform weighted summation on the attention results in the horizontal and vertical directions to generate an updated feature representation. The calculation formula is as follows: ; Step S214: The residual connection is performed with patch, and the final output feature can be expressed as: ; Step S215: Repeat step S214 to achieve global receptive field coverage through two cross-attention mechanisms.

5. The method for detecting defects in a power transmission line according to claim 4, characterized in that: The step S4: inputting the image to be detected into the trained target detection network based on cross attention and ensemble learning to obtain the detection result of each branch network; Filter the test results that need secondary classification and input them into the trained classification network for further classification to obtain the final test results, including: Step S41: input the image to be detected into the trained object detection network based on cross attention and ensemble learning to obtain the detection result of each branch network; Step S42: Mapping the detection results of all branch networks back to the image to be detected, removing all detection results of other categories, and filtering redundant detection results using NMS non-maximum suppression; finally, screening the detection results that require secondary classification; Step S43: Cut out the defective target from the corresponding image according to the position information of the detection result that needs secondary classification, and then send it to the trained classification network to obtain further classification results and update the category of the detection result. as the final test result.

6. A power transmission line defect detection system, characterized in that: Includes the following modules: Construct a training set module to obtain multi-angle drone aerial images of different power transmission lines to establish an initial data set; group the initial data set to construct a target detection training set; crop defective targets that are difficult to identify in the initial data set to construct a classification training set; Constructing and training a target network module for constructing a target detection network based on cross attention and ensemble learning, the network comprising: a Res-CCA module, an improved backbone module and a shared detection head module; inputting the target detection training set into the target detection network based on cross attention and ensemble learning for training; Training a classification network module, inputting the classification training set into the classification network for training; The detection module is used to input the image to be detected into the trained target detection network based on cross attention and ensemble learning to obtain the detection results of each branch network; filter the detection results that need secondary classification and input them into the trained classification network for further classification to obtain the final detection results.

7. A transmission line defect detection device, characterized in that: The method comprises one or more electronic devices, wherein the one or more electronic devices are used to implement the method according to any one of claims 1 to 5.

8. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

9. A computer-readable storage medium, characterized in that: Executable instructions are stored thereon, and when the instructions are executed by a processor, the processor implements the method according to any one of claims 1 to 5.

10. A non-transitory computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Universal image target detection method and device based on self-attention mechanism

    CN113902926A

  • Substation guardrail segmentation method based on channel attention ENet

    CN115761227A