A power line defect detection method and device based on multi-scale context fusion and multi-branch attention down-sampling

By introducing multi-scale context fusion and multi-branch attention downsampling methods, the YOLO26 model is improved, which solves the problems of multi-scale feature fusion and downsampling information loss in power line defect detection and improves the accuracy of small target defect detection.

CN122391880APending Publication Date: 2026-07-14GUANGDONG UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG UNIV OF TECH
Filing Date
2026-04-23
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing target detectors suffer from problems such as unsatisfactory multi-scale feature fusion and downsampling information retention in power line defect detection, failing to meet the accuracy requirements for small target defect detection.

Method used

A multi-scale context fusion and multi-branch attention downsampling approach is adopted. By introducing the multi-branch attention downsampling module MBAD and the multi-scale context fusion module MCF, the YOLO26 model is improved for power line defect detection.

Benefits of technology

It significantly enhances the ability to retain the defect features of small targets and improves the model's ability to perceive and recognize weakly featured defect targets in complex backgrounds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122391880A_ABST
    Figure CN122391880A_ABST
Patent Text Reader

Abstract

The application discloses a power line defect detection method and device based on multi-scale context fusion and multi-branch attention downsampling, and relates to the technical field of power equipment detection. The method comprises the following steps: acquiring a power transmission line image and constructing a data set, and dividing a training set and a verification set. The YOLO26 model is improved: a multi-branch attention downsampling module is introduced into a backbone network to relieve the loss of details in the downsampling process and enhance the small target feature reservation; a multi-scale context fusion module is introduced after a feature fusion path of a neck network to improve the perception ability of the model to weak feature targets in a complex background through cross-scale interaction and progressive enhancement. An end-to-end non-freezing strategy is used to train the model, and a test image is used for verification, and a defect prediction frame is output. While the detection precision and robustness are improved, the calculation complexity is kept low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power equipment testing technology, and in particular to a method and apparatus for detecting power line defects based on multi-scale context fusion and multi-branch attention downsampling. Background Technology

[0002] Power line inspection technology, as an important means to ensure the safe operation of the power grid, has the potential for wide application in power system maintenance. Unmanned aerial vehicle (UAV) inspections can cover a large area of ​​transmission lines, making defect detection possible in complex terrain and harsh environments; vision-based intelligent inspection technology is non-contact and highly efficient, making it suitable for daily inspections of high-voltage transmission lines.

[0003] In recent years, the rapid development of deep learning technology has provided powerful tools for image recognition and detection. However, traditional target detectors have certain limitations in power line defect detection. Existing target detectors are not ideal in multi-scale feature fusion and downsampling information preservation, and cannot meet the accuracy requirements for small target defect detection. Summary of the Invention

[0004] The purpose of this invention is to provide a method and apparatus for detecting power line defects based on multi-scale context fusion and multi-branch attention downsampling, aiming to solve or improve at least one of the above-mentioned technical problems.

[0005] To achieve the above objectives, the present invention provides the following solution: A power line defect detection method based on multi-scale context fusion and multi-branch attention downsampling includes: Acquire images of power transmission lines, construct a power line defect image set, and divide it into a training set and a validation set; An improved defect detection model is constructed based on the YOLO26 model. In the backbone network, the original downsampling convolution module is replaced with a multi-branch attention downsampling module (MBAD). In the neck network, a multi-scale context fusion module (MCF) is introduced after each stage of the feature fusion path. An end-to-end, non-freezing strategy is adopted, and the defect detection model is trained using training and testing sets to generate the final defect detection model. Using the final defect detection model, input the test image and output a predicted bounding box for power line defects.

[0006] Furthermore, the Multi-Branch Attention Downsampling Module (MBAD) adopts a multi-branch parallel architecture, including the ADown attention downsampling branch, the depthwise separable convolution downsampling branch, the dilated convolution downsampling branch, and the residual connection branch. The outputs of the ADown attention downsampling branch, the depthwise separable convolution downsampling branch, and the dilated convolution downsampling branch are concatenated along the channel dimension. Feature fusion is performed using grouped convolution, and the result is element-wise added to the output of the residual connection branch to generate the final output of the MBAD module. The expression is as follows: In the formula, This is the output feature map of the MBAD module; These are the outputs of the ADown attention downsampling branch, the depthwise separable convolution downsampling branch, and the dilated convolution downsampling branch, respectively. This is a grouped convolution operation; Number of groups; This is an element-wise addition operation; This is the output of the residual connection branch.

[0007] Furthermore, the expression for the ADown attention downsampling branch processing flow is: In the formula, Input feature map; for Average pooling operation; This is a channel-sharing operation; The segmented feature map; This is a convolution operation with a stride of 2; Step size; This is a max pooling operation; For splicing operations; This is the output feature map of the ADown attention downsampling branch.

[0008] Furthermore, the expression for the depthwise separable convolution downsampling branch processing flow is as follows: In the formula, The output feature map of the depthwise separable convolution downsampling branch; This is a convolution operation with a stride of 1; It is a depthwise separable convolution with a stride of 2.

[0009] Furthermore, the expression for the dilated convolution downsampling branch processing flow is as follows: In the formula, The output feature map of the dilated convolution downsampling branch; For batch normalization; The SiLU activation function; Void ratio; The step size.

[0010] Furthermore, the expression for the residual join branch processing flow is: In the formula, The output feature map of the residual connection branch; For Average pooling operation.

[0011] Furthermore, the multi-scale context fusion module (MCF) adopts a three-branch parallel architecture, including a global context branch, a multi-scale local branch, and a dynamic feature branch. The global context branch has the following expression: In the formula, For global features; Input feature map; This is an element-wise multiplication operation; For the Sigmoid function; For global adaptive average pooling; for Depthwise separable convolution operations; Multi-scale local branching, expressed as: In the formula, It is a local multi-scale feature; for Convolution operations; Dynamic feature branches, the expression is: In the formula, It is a dynamic feature; Global features, local multi-scale features, and dynamic features are input into the cross-scale interactive fusion module to generate interactive fused features; The interactive fusion features are input into the progressive feature enhancement module to generate an enhanced feature map; The enhanced feature map is residually concatenated with the input feature map to generate the final output of the MCF module.

[0012] Furthermore, the cross-scale interactive fusion module is expressed as follows: In the formula, Features of interactive integration; For the first Weighting coefficients for road features; For the first Feature map of the input branch; For adaptive pooling operations; To exclude the first Feature maps of the other two input branches outside the main path.

[0013] Furthermore, the progressive feature enhancement module is expressed as follows: In the formula, To enhance the feature map; To initially enhance the feature map; For the Sigmoid function; The SiLU activation function; This is a global average pooling operation.

[0014] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects: This invention discloses a method and apparatus for power line defect detection based on multi-scale context fusion and multi-branch attention downsampling. The method, by introducing the MBAD multi-branch attention downsampling module, alleviates the problem of loss of detailed information during downsampling and significantly enhances the ability to preserve the features of small target defects. The MCF multi-scale context fusion module achieves efficient interaction and fusion of global context, multi-scale local features, and dynamic features, and, combined with cross-scale feature interaction and progressive feature enhancement strategies, improves the model's ability to perceive and recognize weakly featured defect targets in complex backgrounds. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a schematic flowchart of the method of the present invention; Figure 2 This is a schematic diagram of the defect detection model in this embodiment; Figure 3 This is a schematic diagram of the Multi-Branch Attention Downsampling (MBAD) module in this embodiment; Figure 4 This is a schematic diagram of the multi-scale context fusion module (MCF) in this embodiment; Figure 5 This is a schematic diagram of the cross-scale interactive fusion module and the progressive feature enhancement module in this embodiment; Figure 6 This is a schematic diagram of the power line defect detection device in this embodiment; In the diagram, 101 is a computer; 102 is a drone; 103 is a high-definition camera; and 104 is a power transmission line. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] The purpose of this invention is to provide a method and apparatus for detecting power line defects based on multi-scale context fusion and multi-branch attention downsampling, aiming to solve or improve at least one of the above-mentioned technical problems.

[0019] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0020] like Figure 1 As shown, this invention provides a power line defect detection method based on multi-scale context fusion and multi-branch attention downsampling, comprising: Step 1: Obtain images of power transmission lines, construct a power line defect image set, and divide it into a training set and a validation set; In this embodiment, the image size is (Number of channels) high (Width); Image annotation uses the open-source tool labelImg, and the annotation content is the defect category and the coordinates of the top left and bottom right corners of the defect target.

[0021] Step 2: Improve the YOLO26 model to construct a defect detection model. Specifically, in the backbone network, the original downsampling convolutional module is replaced with a multi-branch attention downsampling module (MBAD). In the neck network, a multi-scale context fusion module (MCF) is introduced after each stage of the feature fusion path, including: like Figure 2 As shown, the defect detection model executes the following process: The power line defect image set is input into the backbone network, and initial features are extracted through a standard convolutional layer (layer 0). The output size is... The image; in the subsequent downsampling stage, this embodiment uses the MBAD module to perform multi-branch feature downsampling in layers 1, 3, 5, and 7 of the backbone, outputting feature maps with 128, 256, 512, and 1024 channels respectively, corresponding to sizes of , , and Ultimately, the backbone network outputs feature maps at three different scales. , and The dimensions are respectively , and 20 20.

[0022] In the neck network, a Feature Pyramid Network (FPN) structure is used for multi-scale feature fusion. To achieve efficient interaction of feature maps and enhance the network's ability to perceive complex backgrounds, MCF modules are designed in the feature fusion paths of layers 18 and 22 of the neck network.

[0023] The MCF module fine-tunes the fused features using a multi-branch architecture. Ultimately, the neck network outputs feature maps at three different scales. , and The dimensions are respectively , and The three feature maps are fed into the detection head for target detection.

[0024] like Figure 3 As shown, the MBAD module employs a multi-branch parallel architecture, consisting of an ADown attention downsampling branch, a depthwise separable convolution downsampling branch, a dilated convolution downsampling branch, and a residual connection branch. In this embodiment, taking the MBAD module at layer 3 of the backbone network as an example, given the input feature map... It requires a 2x downsampling to output the feature map. .

[0025] The ADown attention downsampling branch first performs 2×2 average pooling on the input feature map, and then divides it into two parts along the channel dimension. One part is downsampled by a 3×3 convolution with a stride of 2, and the other part is max pooled by a 3×3 convolution with a stride of 2, and then channel adjustment is performed by a 1×1 convolution. The results of the two parts are concatenated along the channel dimension and used as the branch output.

[0026] The expression for the ADown attention downsampling branch processing flow is: In the formula, Input feature map; for Average pooling operation; This is a channel-sharing operation; The segmented feature map has 64 channels. This is a convolution operation with a stride of 2; Step size; This is a max pooling operation; For splicing operations; The output feature map of the ADown attention downsampling branch has a size of [size missing]. .

[0027] The depthwise separable convolution downsampling branch uses a 3×3 depthwise separable convolution (DWConv) with a stride of 2 to capture local information and adjusts the channels through a 1×1 standard convolution as the branch output, expressed as: In the formula, The output feature map of the depthwise separable convolution downsampling branch has a size of [size missing]. ; It is a depthwise separable convolution with a stride of 2.

[0028] The dilated convolution downsampling branch expands the receptive field using a 3×3 standard convolution with a dilation of 2 and a stride of 2, followed by batch normalization (BN) and SiLU activation, which is then used as the branch output. The expression is as follows: In the formula, The output feature map of the dilated convolution downsampling branch has a size of [size missing]. ; Void ratio; For batch normalization; The SiLU activation function; Void ratio; The step size.

[0029] The residual connection branch takes the input feature map as its output after being downsampled by 2×2 average pooling and then adjusted by 1×1 convolution. The expression for this output is: In the formula, The output feature map of the residual connection branch; The outputs of the ADown attention downsampling branch, the depthwise separable convolution downsampling branch, and the dilated convolution downsampling branch are concatenated along the channel dimension. Feature fusion is performed using grouped convolution, and the result is element-wise added to the output of the residual connection branch to generate the final output of the MBAD module. The expression is as follows: In the formula, This is the output feature map of the MBAD module, with a size of [size missing]. ; This is a grouped convolution operation; Number of groups; This is an element-wise addition operation.

[0030] like Figure 4 As shown, the MCF module adopts a three-branch parallel architecture, namely the global context branch, the multi-scale local branch, and the dynamic feature branch. In this embodiment, taking the MCF module of the 18th layer of the neck network as an example, given the input feature map... .

[0031] Global context branch, the input feature map is passed through a Initial feature extraction is performed using depthwise separable convolutions (DWConv), followed by global adaptive average pooling (GAP) to compress the spatial dimensions. Convolutional layers and the sigmoid function generate global attention weights. Finally, the global attention weights are multiplied element-wise with the original input feature map to weight the original features and generate the global features, expressed as: In the formula, For size Global features; Input feature map; This is an element-wise multiplication operation; For the Sigmoid function; For global adaptive average pooling; for Depthwise separable convolution operations; Multi-scale local branching, parallel use , , Convolutional kernels capture local features; the outputs of the three convolutional layers are concatenated along the channel dimension, and then passed through a... Convolutional layers perform channel fusion and dimensionality reduction, expressed as: In the formula, It is a local multi-scale feature; for Convolution operations; Dynamic feature branching, through a A standard convolutional layer is connected in series with one Depthwise separable convolutional layers are used to simulate the adaptive feature extraction process, enhancing the non-linear expressive power of features. The expression is as follows: In the formula, It is a dynamic feature; Global features, local multi-scale features, and dynamic features are input into the cross-scale interactive fusion module for cross-scale interaction, including: like Figure 5 As shown, the cross-scale interactive fusion module adds the features of each branch to the features of the other two branches element-wise after adjusting their size through adaptive pooling, generating three interactive features; each interactive feature is then processed... Convolutional layers and the SiLU activation function are used to fuse channel information, and then the weight coefficients for each channel are calculated using the Softmax function. The weighted sum of the features processed from the three channels is then used to generate interactive fused features, expressed as follows: In the formula, For interactive fusion features, it represents the output feature map after fusing the information of the three branches after cross-scale interaction; For the first Weighting coefficients for road features; For the first Feature map of the input branch; This is an adaptive pooling operation used to make the feature maps of different branches have the same spatial size; To exclude the first Feature maps of the other two input branches outside the main path; The interactive fusion features are input into the progressive feature enhancement module, through two cascaded... The convolutional layer performs feature enhancement, generating a preliminary enhanced feature map; A channel attention mechanism is introduced to sequentially perform global average pooling on the initial enhanced feature map. SiLU activation of convolutional layers and After the convolutional layer, channel weights are generated using the Sigmoid function. Then, the channel weights are multiplied element-wise with the initial enhanced feature map to achieve adaptive weighting of the features for each channel, generating the enhanced feature map. The expression is as follows: In the formula, To enhance the feature map; To initially enhance the feature map; For the Sigmoid function; The SiLU activation function is used to introduce nonlinear characteristics. This is a global average pooling operation; The enhanced feature map is residually concatenated with the input feature map to generate the final output of the MCF module, expressed as: In the formula, The output feature map of the MCF module, with the size maintained at... .

[0032] Step 3: Using an end-to-end, non-freezing strategy, the defect detection model is trained using the training and test sets to generate the final defect detection model. The loss function used is the same as that in the original YOLO network. Specific network training parameters were set as follows: initial learning rate lr = 0.01, batch size = 32, training and validation set ratio of 0.9:0.1, and SGD optimizer (momentum parameter set to 0.937, weight decay coefficient set to 0.0005). A learning rate warmup mechanism was introduced, with a warmup period of 3 rounds and a total training period of 600 rounds. Mosaic data augmentation was automatically disabled in the last 10 rounds of training.

[0033] Step 4: Using the final defect detection model, input the test image and output the predicted bounding box for power line defects.

[0034] First, the image to be tested is preprocessed as follows: The tensor is input into the defect detection model. After forward inference, the model outputs feature maps at three different scales. , and From these multi-scale feature maps, classification and regression prediction values ​​are extracted. After tensor concatenation and dimensionality rearrangement (moving the channel dimension to the end), shapes are generated as follows: Category prediction tensors and The bounding box prediction tensor (where 7 represents 7 types of power line defects).

[0035] Subsequently, the system performs non-maximum suppression to remove redundant boxes. The specific process is as follows: First, based on the confidence threshold ( ) Valid predicted boxes are filtered out and sorted in descending order of confidence; then the intersection-union ratio (IU) of high-confidence boxes with other boxes is calculated, and boxes with IU ratios greater than a set threshold are removed. Redundant predictions were eliminated. The filtered detection boxes were restored to the original image resolution, and the maximum number of detections per image was limited to 300. Finally, the coordinates of the detection boxes were converted to normalized locations. The data is then plotted on the test image. If the final output contains the detection box, the transmission line is determined to have a defect; otherwise, it is considered normal.

[0036] like Figure 6 As shown, in one embodiment, the present invention provides a power line defect detection device, including: a computer 101, a drone 102, a high-definition camera 103, and a power transmission line 104; Computer 101 is connected to drone 102 via wireless communication. Drone 102 is equipped with a high-definition camera 103 to take pictures of power transmission line 104. Computer 101 acquires images of power transmission line 104 and performs power line defect detection through deep learning image detection algorithms.

[0037] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0038] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A power line defect detection method based on multi-scale context fusion and multi-branch attention downsampling, characterized in that, include: Acquire images of power transmission lines, construct a power line defect image set, and divide it into a training set and a validation set; An improved defect detection model is constructed based on the YOLO26 model. In the backbone network, the original downsampling convolution module is replaced with a multi-branch attention downsampling module (MBAD). In the neck network, a multi-scale context fusion module (MCF) is introduced after each stage of the feature fusion path. An end-to-end, non-freezing strategy is adopted, and the defect detection model is trained using training and testing sets to generate the final defect detection model. Using the final defect detection model, input the test image and output a predicted bounding box for power line defects.

2. The power line defect detection method based on multi-scale context fusion and multi-branch attention downsampling according to claim 1, characterized in that, The Multi-Branch Attention Downsampling Module (MBAD) adopts a multi-branch parallel architecture, including an ADown attention downsampling branch, a depthwise separable convolution downsampling branch, a dilated convolution downsampling branch, and a residual connection branch. The outputs of the ADown attention downsampling branch, the depthwise separable convolution downsampling branch, and the dilated convolution downsampling branch are concatenated along the channel dimension. Feature fusion is performed using grouped convolution, and the result is element-wise added to the output of the residual connection branch to generate the final output of the MBAD module. The expression is as follows: In the formula, This is the output feature map of the MBAD module; These are the outputs of the ADown attention downsampling branch, the depthwise separable convolution downsampling branch, and the dilated convolution downsampling branch, respectively. This is a grouped convolution operation; Number of groups; This is an element-wise addition operation; This is the output of the residual connection branch.

3. The power line defect detection method based on multi-scale context fusion and multi-branch attention downsampling according to claim 2, characterized in that, The expression for the ADown attention downsampling branch processing flow is: In the formula, Input feature map; for Average pooling operation; This is a channel-sharing operation; The segmented feature map; This is a convolution operation with a stride of 2; Step size; This is a max pooling operation; For splicing operations; This is the output feature map of the ADown attention downsampling branch.

4. The power line defect detection method based on multi-scale context fusion and multi-branch attention downsampling according to claim 2, characterized in that, The expression for the depth-separable convolutional downsampling branch processing flow is as follows: In the formula, The output feature map of the depthwise separable convolution downsampling branch; This is a convolution operation with a stride of 1; It is a depthwise separable convolution with a stride of 2.

5. The power line defect detection method based on multi-scale context fusion and multi-branch attention downsampling according to claim 2, characterized in that, The expression for the dilated convolution downsampling branch processing flow is: In the formula, The output feature map of the dilated convolution downsampling branch; For batch normalization; The SiLU activation function; Void ratio; The step size.

6. The power line defect detection method based on multi-scale context fusion and multi-branch attention downsampling according to claim 2, characterized in that, The expression for the residual connection branch processing flow is: In the formula, The output feature map of the residual connection branch; For Average pooling operation.

7. The power line defect detection method based on multi-scale context fusion and multi-branch attention downsampling according to claim 1, characterized in that, The multi-scale context fusion module (MCF) adopts a three-branch parallel architecture, including a global context branch, a multi-scale local branch, and a dynamic feature branch. The global context branch has the following expression: In the formula, For global features; Input feature map; This is an element-wise multiplication operation; For the Sigmoid function; For global adaptive average pooling; for Depthwise separable convolution operations; Multi-scale local branching, expressed as: In the formula, It is a local multi-scale feature; for Convolution operations; Dynamic feature branches, the expression is: In the formula, It is a dynamic feature; Global features, local multi-scale features, and dynamic features are input into the cross-scale interactive fusion module to generate interactive fused features; The interactive fusion features are input into the progressive feature enhancement module to generate an enhanced feature map; The enhanced feature map is residually concatenated with the input feature map to generate the final output of the MCF module.

8. The power line defect detection method based on multi-scale context fusion and multi-branch attention downsampling according to claim 7, characterized in that, The expression for the cross-scale interactive fusion module is: In the formula, Features of interactive integration; For the first Weighting coefficients for road features; For the first Feature map of the input branch; For adaptive pooling operations; To exclude the first Feature maps of the other two input branches outside the main path.

9. The power line defect detection method based on multi-scale context fusion and multi-branch attention downsampling according to claim 7, characterized in that, The progressive feature enhancement module is expressed as follows: In the formula, To enhance the feature map; To initially enhance the feature map; For the Sigmoid function; The SiLU activation function; This is a global average pooling operation.

10. A power line defect detection device applying the detection method described in claims 1-9, characterized in that, include: Computer (101), drone (102), high-definition camera (103), power transmission line (104). The computer (101) connects to the drone (102) via wireless communication. The drone (102) is equipped with a high-definition camera (103) to take pictures of the power transmission line (104). The computer (101) obtains images of the power transmission line (104) and performs power line defect detection through a deep learning image detection algorithm.