Method, device, equipment, storage medium and program product for detecting electrical components on a tower

By improving the YOLOv11 model through a deep feature fusion module, the detection accuracy of electrical components on poles and towers has been enhanced, solving the problem of inaccurate positioning and classification in existing technologies and improving the detection capability of small targets.

CN122223486APending Publication Date: 2026-06-16GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
Filing Date
2026-03-06
Publication Date
2026-06-16

Smart Images

  • Figure CN122223486A_ABST
    Figure CN122223486A_ABST
Patent Text Reader

Abstract

The application relates to a tower electrical component detection method, device, equipment, storage medium and program product. A detection image of a tower on a power line is acquired, and a detection result of an electrical component on the tower is obtained according to the detection image and a target detection model. Since a first splicing module in a neck network of a single-stage real-time target detection algorithm version 11 (YOLOv11) model is replaced by an initial detection model obtained by using a deep feature fusion module, the target detection model is obtained by training the initial detection model, and the detection image of the tower is detected by using the target detection model, so that the accuracy of the detection result of the electrical component on the tower, that is, the accuracy of positioning and classification of the electrical component on the tower, is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of target detection technology, and in particular to a method, apparatus, equipment, storage medium, and program product for detecting electrical components on poles and towers. Background Technology

[0002] As a crucial link connecting the transmission network and end users, the reliability, power quality, and operational safety of the distribution network are receiving increasing attention. Among these, 10kV overhead lines constitute the backbone of the distribution network, widely distributed throughout urban and rural areas, and their operational status directly affects the normal order of social production and daily life.

[0003] However, routine maintenance, emergency repairs, and upgrades of 10kV lines involve numerous high-risk operations at heights, on energized or near live conductors, in complex and variable working environments with significant safety risks. The primary task in line repair is accurately locating and classifying electrical components, such as damaged insulators. For a long time, supervision of these operations has relied mainly on traditional methods such as manual on-site inspections of electrical components on poles, remote video monitoring, and post-event record analysis. This approach suffers from low accuracy in locating and classifying electrical components on poles.

[0004] Therefore, how to provide a deep learning-based target detection algorithm to improve the accuracy of locating and classifying electrical components on poles is an urgent problem to be solved in this field. Summary of the Invention

[0005] Therefore, it is necessary to provide a method, apparatus, equipment, storage medium, and program product for detecting electrical components on poles and towers that can improve the accuracy and efficiency of locating and classifying electrical components on poles and towers, in response to the above-mentioned technical problems.

[0006] In a first aspect, this application provides a method for testing electrical components on a pole, including:

[0007] Acquire detection images of power line towers;

[0008] Based on the detected images and the target detection model, the detection results of electrical components on the tower are obtained. The target detection model is obtained by training an initial detection model. The initial detection model is a model obtained by replacing at least the first stitching module in the neck network of the YOLOv11 single-stage real-time target detection algorithm using a deep feature fusion module. The first stitching module is a module connected to the first upsampling module in the neck network. The neck network includes a first upsampling module and a second upsampling module. The first upsampling module is the next upsampling module after the second upsampling module. The deep feature fusion module includes a first merging module, a pooling module, a weight acquisition module, and a second merging module. The weight acquisition module includes a first weight acquisition module and a second weight acquisition module.

[0009] The first merging module is used to merge the first feature map and the second feature map to obtain the first merged feature map. The first feature map is a feature map obtained by upsampling the feature map from the first resolution feature map, and the second feature map is a second resolution feature map. The resolution of the first resolution feature map is smaller than the resolution of the second resolution feature map.

[0010] The pooling module is used to obtain a target pooled feature map based on the first merged feature map, the first resolution feature map, and the second resolution feature map.

[0011] The first weight acquisition module is used to determine the first weight corresponding to the first resolution feature map based on the target pooling feature map;

[0012] The second weight acquisition module is used to determine the second weights corresponding to the second resolution feature map based on the target pooling feature map.

[0013] The second merging module is used to multiply the first weight with the first feature map to obtain the first target feature map, and to multiply the second weight with the second feature map to obtain the second target feature map, and to merge the first target feature map and the second target feature map to obtain the second merged feature map.

[0014] In one embodiment, the pooling module includes a max pooling module and an average pooling module, and the target pooling feature map includes a first pooling feature map, a second pooling feature map, a third pooling feature map, a fourth pooling feature map, a fifth pooling feature map, and a sixth pooling feature map.

[0015] The max pooling module is used to obtain a first pooling feature map corresponding to the first merged feature map, a second pooling feature map corresponding to the first feature map, and a third pooling feature map corresponding to the second feature map based on the first merged feature map, the first resolution feature map, and the second resolution feature map.

[0016] The average pooling module is used to obtain a fourth pooling feature map corresponding to the first merged feature map, a fifth pooling feature map corresponding to the first feature map, and a sixth pooling feature map corresponding to the second feature map based on the first merged feature map, the first resolution feature map, and the second resolution feature map.

[0017] In one embodiment, the deep feature fusion module further includes a first convolution module, which is used to perform convolution processing on the first merged feature map to obtain a first convolution feature map;

[0018] The max pooling module is used to perform max pooling on the first convolutional feature map, the first feature map, and the second feature map to obtain a first pooled feature map corresponding to the first merged feature map, a second pooled feature map corresponding to the first feature map, and a third pooled feature map corresponding to the second feature map.

[0019] The average pooling module is used to perform average pooling on the first convolutional feature map, the first feature map, and the second feature map to obtain the fourth pooling feature map corresponding to the first convolutional feature map, the fifth pooling feature map corresponding to the first feature map, and the sixth pooling feature map corresponding to the second feature map.

[0020] In one embodiment, the deep feature fusion module further includes a third merging module;

[0021] The third merging module is used to merge the first pooling feature map, the second pooling feature map, the third pooling feature map, the fourth pooling feature map, the fifth pooling feature map, and the sixth pooling feature map to obtain the third merged feature map.

[0022] The first weight acquisition module is used to perform convolution processing on the third merged feature map to obtain the second convolution feature map, and determine the first weight based on the second convolution feature map;

[0023] The second weight acquisition module is used to perform convolution processing on the third merged feature map to obtain the third convolution feature map, and to determine the second weight based on the third convolution feature map.

[0024] In one embodiment, the initial detection model is a model obtained by replacing the first splicing module with the first deep feature fusion module and replacing the second splicing module in the neck network with the second deep feature fusion module. The output channels of the target C3k2 module and the target convolutional layer in the initial detection model are modified to 512. The second splicing module is the splicing module in YOLOv11 that connects to the convolutional layer corresponding to the target convolutional layer.

[0025] The target C3k2 module is connected to the first deep feature fusion module, and the feature map output by the first deep feature fusion module is the input of the target C3k2 module. The target convolutional layer is a convolutional layer connected to the target C3k2 module.

[0026] In one embodiment, the method further includes:

[0027] Obtain a sample image set of the tower;

[0028] Input the sample images from the sample image set into the initial detection model to obtain the predicted anchor boxes in the sample images, and the predicted probability that the target in the predicted anchor box belongs to the actual category of the target.

[0029] Calculate the actual anchor frame based on the predicted anchor frame and the target's actual anchor frame. loss;

[0030] Based on all the actual anchor frames corresponding to the sample image set The crossover ratio regression loss is determined by the loss and the total number of all actual anchor frames;

[0031] The classification loss is calculated based on the predicted probability, the actual class, the probability of matching the predicted probability with the actual class, the focus loss parameter, and the total number of anchor boxes.

[0032] Calculate the distribution loss based on the total number of anchor frames, the total number of actual categories, the predicted probability, and the actual category corresponding to the predicted probability;

[0033] The initial detection model is trained based on the sum of crossover ratio regression loss, classification loss, and distribution loss to obtain the target detection model.

[0034] Secondly, this application also provides a testing device for electrical components on a pole, the device comprising:

[0035] The first acquisition module is used to acquire detection images of power line towers;

[0036] The detection module is used to obtain the detection results of electrical components on the tower based on the detected image and the target detection model. The target detection model is obtained by training an initial detection model. The initial detection model is obtained by using a deep feature fusion module to replace at least the first stitching module in the neck network of the YOLOv11 single-stage real-time target detection algorithm. The first stitching module is a module connected to the first upsampling module in the neck network. The neck network includes a first upsampling module and a second upsampling module. The first upsampling module is the next upsampling module after the second upsampling module. The deep feature fusion module includes a first merging module, a pooling module, a weight acquisition module, and a second merging module. The weight acquisition module includes a first weight acquisition module and a second weight acquisition module.

[0037] The first merging module is used to merge the first feature map and the second feature map to obtain the first merged feature map. The first feature map is a feature map obtained by upsampling the feature map from the first resolution feature map, and the second feature map is a second resolution feature map. The resolution of the first resolution feature map is smaller than the resolution of the second resolution feature map.

[0038] The pooling module is used to obtain a target pooled feature map based on the first merged feature map, the first resolution feature map, and the second resolution feature map.

[0039] The first weight acquisition module is used to determine the first weight corresponding to the first resolution feature map based on the target pooling feature map;

[0040] The second weight acquisition module is used to determine the second weights corresponding to the second resolution feature map based on the target pooling feature map.

[0041] The second merging module is used to multiply the first weight with the first feature map to obtain the first target feature map, and to multiply the second weight with the second feature map to obtain the second target feature map, and to merge the first target feature map and the second target feature map to obtain the second merged feature map.

[0042] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the above methods.

[0043] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above methods.

[0044] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above methods.

[0045] The aforementioned method, apparatus, equipment, storage medium, and program products for detecting electrical components on power poles acquire detection images of the poles along power lines. Based on the detection images and a target detection model, they obtain the detection results of the electrical components on the poles. By utilizing a deep feature fusion module, at least the first stitching module in the neck network of the YOLOv11 single-stage real-time target detection algorithm is replaced to obtain an initial detection model. This initial detection model is then trained to obtain a target detection model. Using this target detection model to detect the pole images improves the accuracy of the detection results for electrical components on the poles, thus improving the accuracy of the localization and classification of the electrical components. Attached Figure Description

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

[0047] Figure 1 This is an application environment diagram of the electrical component detection method on a pole in one embodiment;

[0048] Figure 2 This is a schematic diagram of a deep feature fusion module in one embodiment;

[0049] Figure 3 This is a schematic diagram of the initial detection model in one embodiment;

[0050] Figure 4 This is a flowchart illustrating the model training method in one embodiment;

[0051] Figure 5 This is a schematic diagram of the electrical component detection device on a pole in one embodiment;

[0052] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0054] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0055] In one exemplary embodiment, such as Figure 1 As shown, Figure 1 This is a flowchart illustrating a method for detecting electrical components on a power pole in one embodiment. The method is illustrated using an electrical component detection device, which can be a power robot. The method includes the following steps:

[0056] S101, acquire detection images of power line towers.

[0057] S102, based on the detected image and the target detection model, the detection results of the electrical components on the tower are obtained; the target detection model is obtained by training the initial detection model. The initial detection model is obtained by using a deep feature fusion module to replace at least the first stitching module in the neck network of the YOLOv11 single-stage real-time target detection algorithm version 11 model. The first stitching module is a module connected to the first upsampling module in the neck network. The neck network includes the first upsampling module and the second upsampling module. The first upsampling module is the next upsampling module of the second upsampling module.

[0058] YOLOv11 is short for You Only Look Once Version 11, referring to the 11th version of the single-stage real-time object detection algorithm. The deep feature fusion module can be represented by the DFM module below. The neck network in YOLOv11 includes two sampling modules. The Cross Stage Partial with Pyramid Squeeze Attention (C2PSA) module in the backbone network of YOLOv11 is connected to the first upsampling module in the neck network of YOLOv11. In this embodiment, the second upsampling module refers to the first upsampling module in the neck network of YOLOv11.

[0059] The deep feature fusion module includes a first merging module, a pooling module, a weight acquisition module, and a second merging module. The weight acquisition module includes a first weight acquisition module and a second weight acquisition module.

[0060] The first merging module is used to merge the first feature map and the second feature map to obtain the first merged feature map. The first feature map is a feature map obtained by upsampling the feature map from the first resolution feature map, and the second feature map is a second resolution feature map. The resolution of the first resolution feature map is smaller than the resolution of the second resolution feature map.

[0061] The pooling module is used to obtain a target pooled feature map based on the first merged feature map, the first resolution feature map, and the second resolution feature map.

[0062] The first weight acquisition module is used to determine the first weight corresponding to the first resolution feature map based on the target pooling feature map;

[0063] The second weight acquisition module is used to determine the second weights corresponding to the second resolution feature map based on the target pooling feature map.

[0064] The second merging module is used to multiply the first weight with the first feature map to obtain the first target feature map, and to multiply the second weight with the second feature map to obtain the second target feature map, and to merge the first target feature map and the second target feature map to obtain the second merged feature map.

[0065] The first feature map is obtained by upsampling the feature map from the first resolution feature map. The second feature map is the feature map at a second resolution, where the resolution of the first resolution feature map is smaller than that of the second resolution feature map. The first resolution feature map is the feature map output by the preceding C3k2 module of the first upsampling module. This preceding C3k2 module is a module in the neck network of the object detection model and is connected to the first upsampling module. The first upsampling module upsamples the first resolution feature map output by the preceding C3k2 module to obtain the first feature map. The first feature map and the second feature map can be input into the first merging module for merging. The preceding C3k2 module can be one of the following: Figure 3 The fifth C3k2 module. The first upsampling module is... Figure 3 Upsampling module 1 in the module. The C3k2 module is short for Cross-Stage Partial with 2 Convolutions.

[0066] The second feature map can be the feature map output by the second C3k2 module in the backbone network of the object detection model. The second C3k2 module refers to the C3k2 module closest to the input layer, starting from the input of the backbone network. Figure 3 The first C3k2 module in the code, and the next C3k2 module after the first C3k2 module is the second C3k2 module, that is, as follows: Figure 3 The second C3k2 module, and so on, the next C3k2 module is the third C3k2 module, the next C3k2 module is the fourth C3k2 module, the fourth C3k2 module is connected to the Spatial Pyramid Pooling Fusion (SPFF) module, and the SPFF module is connected to the CSPSA module.

[0067] The pooling module may include a max pooling module and / or an average pooling module. When the pooling module includes a max pooling module, the target pooling feature map may include a first pooling feature map, a second pooling feature map, and a third pooling feature map. When the pooling module includes an average pooling module, the target pooling feature map may include a fourth pooling feature map, a fifth pooling feature map, and a sixth pooling feature map. When the pooling module includes both max pooling and average pooling modules, the target pooling feature map may include the first, second, third, fourth, fifth, and sixth pooling feature maps.

[0068] The first merging module merges the first feature map and the second feature map to obtain the first merged feature map. The first feature map is obtained by upsampling the feature map from the first resolution feature map, and the second feature map is the second resolution feature map. The resolution of the first resolution feature map is smaller than that of the second resolution feature map. The second resolution feature map has rich spatial details and accurate localization, making it suitable for small target detection and precise boundary localization. Meanwhile, the first resolution feature map has rich semantic information and a large receptive field, making it suitable for target classification and global context understanding. Therefore, in this embodiment, the first merging module can achieve information complementarity, enhance representation capabilities, balance global semantics and local details, and improve the completeness of feature representation. Thus, fully fusing multi-scale features helps generate more accurate bounding boxes and reduce localization errors.

[0069] In this embodiment, by acquiring detection images of power line towers, the detection results of electrical components on the towers are obtained based on the detection images and the target detection model. Since the initial detection model is obtained by replacing at least the first stitching module in the neck network of the YOLOv11 single-stage real-time target detection algorithm using a deep feature fusion module, and then training the initial detection model to obtain the target detection model, the accuracy of the detection results of electrical components on the towers can be improved, thus improving the accuracy of the localization and classification of electrical components on the towers.

[0070] In one exemplary embodiment, such as Figure 2 As shown, Figure 2 This is a schematic diagram of a deep feature fusion module in one embodiment. The pooling module includes a max pooling module and an average pooling module. The target pooling feature map includes a first pooling feature map, a second pooling feature map, a third pooling feature map, a fourth pooling feature map, a fifth pooling feature map, and a sixth pooling feature map.

[0071] The max pooling module is used to obtain a first pooling feature map corresponding to the first merged feature map, a second pooling feature map corresponding to the first feature map, and a third pooling feature map corresponding to the second feature map based on the first merged feature map, the first resolution feature map, and the second resolution feature map.

[0072] The average pooling module is used to obtain a fourth pooling feature map corresponding to the first merged feature map, a fifth pooling feature map corresponding to the first feature map, and a sixth pooling feature map corresponding to the second feature map based on the first merged feature map, the first resolution feature map, and the second resolution feature map.

[0073] The max pooling module can perform max pooling on the first merged feature map, the first resolution feature map, and the second resolution feature map to obtain a first pooled feature map corresponding to the first merged feature map, a second pooled feature map corresponding to the first feature map, and a third pooled feature map corresponding to the second feature map. Alternatively, the max pooling module can perform max pooling on the first convolutional feature map, the first feature map, and the second feature map to obtain a first pooled feature map corresponding to the first merged feature map, a second pooled feature map corresponding to the first feature map, and a third pooled feature map corresponding to the second feature map. The first convolutional feature map can be the feature map obtained by the first convolution module performing convolution processing on the first merged feature map. The first convolution module may include... Figure 2 The convolutional module can have a first convolutional layer, a second convolutional layer, and a third convolutional layer. The first convolutional layer can be a 1×1 convolutional layer, the second convolutional layer can be a 3×3 convolutional layer, and the third convolutional layer can be a 1×1 convolutional layer. Alternatively, the first convolutional module can include... Figure 2 The first, second, and third convolutional layers in the model are partially convolutional layers.

[0074] The average pooling module is used to obtain a fourth pooling feature map corresponding to the first merged feature map, a fifth pooling feature map corresponding to the first feature map, and a sixth pooling feature map corresponding to the second feature map based on the first merged feature map, the first resolution feature map, and the second resolution feature map.

[0075] In this embodiment, by using a pooling module that includes a max pooling module and an average pooling module, a greater number of pooling feature maps can be obtained, namely, six pooling feature maps: a first pooling feature map, a second pooling feature map, a third pooling feature map, a fourth pooling feature map, a fifth pooling feature map, and a sixth pooling feature map. This facilitates the subsequent merging of these six feature maps along the channel dimension to obtain a more informative merged feature map, thereby improving the accuracy of the detection results of electrical components on the tower when performing subsequent detection based on the merged feature map.

[0076] In an exemplary embodiment, the deep feature fusion module further includes a first convolution module, which is used to perform convolution processing on the first merged feature map to obtain a first convolution feature map.

[0077] The max pooling module is used to perform max pooling on the first convolutional feature map, the first feature map, and the second feature map to obtain a first pooled feature map corresponding to the first merged feature map, a second pooled feature map corresponding to the first feature map, and a third pooled feature map corresponding to the second feature map.

[0078] The average pooling module is used to perform average pooling on the first convolutional feature map, the first feature map, and the second feature map to obtain the fourth pooling feature map corresponding to the first convolutional feature map, the fifth pooling feature map corresponding to the first feature map, and the sixth pooling feature map corresponding to the second feature map.

[0079] like Figure 2 As shown, the first convolutional module may include Figure 2 The first, second, and third convolutional layers in the model can be 1×1, 3×3, and 1×1 respectively.

[0080] After obtaining the first convolutional feature map through the first convolution module, the first convolutional feature map, the first feature map, and the second feature map can be input into the max pooling module for max pooling processing; the first convolutional feature map, the first feature map, and the second feature map can be input into the average pooling module for average pooling processing.

[0081] In this embodiment, the first convolutional feature map is obtained by performing convolution processing on the first merged feature map through the first convolution module, which makes the feature information of the obtained first convolutional map richer, thereby making the information of the six pooling feature maps richer, and further improving the accuracy of the detection results of electrical components on the tower.

[0082] In one exemplary embodiment, such as Figure 2 As shown, the deep feature fusion module also includes a third merging module;

[0083] The third merging module is used to merge the first pooling feature map, the second pooling feature map, the third pooling feature map, the fourth pooling feature map, the fifth pooling feature map, and the sixth pooling feature map to obtain the third merged feature map.

[0084] The first weight acquisition module is used to perform convolution processing on the third merged feature map to obtain the second convolution feature map, and determine the first weight based on the second convolution feature map;

[0085] The second weight acquisition module is used to perform convolution processing on the third merged feature map to obtain the third convolution feature map, and to determine the second weight based on the third convolution feature map.

[0086] The first weight acquisition module may include a fourth convolutional layer and a first sigmoid function, and the second weight acquisition module may include a fifth convolutional layer and a second sigmoid function. The fourth and fifth convolutional layers may be 1×1 convolutional layers. The fourth convolutional layer can perform convolution processing on the third merged feature map to obtain a second convolutional feature map, and use the first sigmoid function to obtain the first weight; the fifth convolutional layer can perform convolution processing on the third merged feature map to obtain a third convolutional feature map, and use the second sigmoid function to obtain the second weight.

[0087] In this embodiment, by determining the first weight and the second weight, it is convenient to multiply the first weight with the first feature map to obtain the first target feature map, and multiply the second weight with the second feature map to obtain the second target feature map. The first target feature map and the second target feature map are then merged to obtain the second merged feature map. Based on the second merged feature map, the detection results of the electrical components on the tower are determined, thereby improving the accuracy of the detection results.

[0088] In one exemplary embodiment, Figure 3 This is a schematic diagram of the initial detection model in one embodiment. The backbone network of the initial detection model is the same as that in YOLOv11. The neck network of the initial detection model includes upsampling module 2, stitching module 1, fifth C3k2 module, upsampling module 1, DFM module 1, sixth C3k2 module, convolutional layer 6, DFM module 2, seventh C3k2 module, convolutional layer 7, stitching module 2, and eighth C3k2 module. The head network of the initial detection model is the same as that in YOLOv11, that is, it includes three detection heads as shown in the figure. The kernel size of each convolutional layer in the backbone network of the initial detection model is 3×3, and the stride is 2. The kernel size of convolutional layers 6 and 7 in the neck network is also 3×3, and the stride is 2.

[0089] The model obtained by replacing the first concatenation module with the first deep feature fusion module and the second concatenation module in the neck network with the second deep feature fusion module, and modifying the output channels of the target C3k2 module and the target convolutional layer in the initial detection model to 512, and the second concatenation module is the concatenation module in YOLOv11 that connects to the convolutional layer corresponding to the target convolutional layer; wherein, the first deep feature fusion module can Figure 3 In the DFM module 1, the second deep feature fusion module can be Figure 3The DFM module 2 in the initial detection model. The other modules and convolutional layers in the neck network are consistent with the corresponding modules and convolutional layers in the neck network of YOLOv11. The convolutional layer corresponding to the target convolutional layer in YOLOv11 refers to convolutional layer 6 in YOLOv11; that is, the convolutional layer located between the first and second stitching modules in YOLOv11 is the convolutional layer corresponding to the target convolutional layer in YOLOv11.

[0090] The target C3k2 module is connected to the first deep feature fusion module, and the feature map output by the first deep feature fusion module serves as the input to the target C3k2 module. The target convolutional layer is a convolutional layer connected to the target C3k2 module. Figure 3 The sixth C3k2 module in the model has a target convolutional layer of type C3k2. Figure 3 Convolutional layer 6 in the middle.

[0091] Among them, the target C3k2 module is Figure 3 The sixth C3k2 module in the text refers to the target convolutional layer. Figure 3 Convolutional layer 6. The first deep feature fusion module is... Figure 3 The first DFM module and the second deep feature fusion module are... Figure 3 DFM module 2 in the middle.

[0092] In this embodiment, two deep feature fusion modules are used to replace the first and second splicing modules respectively. The output channels of the target C3k2 module and the target convolutional layer in the initial detection model are modified to 512, thereby further improving the accuracy of the detection results obtained by the target detection model.

[0093] In one exemplary embodiment, Figure 4 This is a flowchart illustrating a model training method in one embodiment. The method includes the following steps:

[0094] S401, Obtain a sample image set of the tower.

[0095] The dataset contains 2314 images, divided into training, validation, and test sets in approximately a 7:2:1 ratio. The training set contains 1599 images, the validation set 457 images, and the test set 228 images. The dataset includes 2601 connectors, 2418 drop-out fuses, 3115 horizontal insulators, 295 overhead switches, 454 transformers, and 8306 vertical insulators. In this example, training requires Ubuntu 18.04.5 LTS or later, with Python 3.9 and PyTorch 2.2. During model training, the input image size is 640×640, the SGD optimizer is used, the initial learning rate is set to 0.01, the momentum is set to 0.9, the batch size is set to 32, and no pre-trained weights are used. Training is performed for a total of 800 epochs, with the remaining settings default.

[0096] S402, input the sample images from the sample image set into the initial detection model to obtain the predicted anchor boxes in the sample images, and the predicted probability that the target in the predicted anchor box belongs to the actual category of the target.

[0097] S403, Calculate the actual anchor frame based on the predicted anchor frame and the actual anchor frame of the target. loss.

[0098] S404, based on all the actual anchor boxes corresponding to the sample image set. The crossover ratio regression loss is determined by taking the loss and the total number of actual anchor frames.

[0099]

[0100] in, This represents the total number of positive anchor boxes labeled in the sample images of the sample image set. These are all the labeled positive sample anchor boxes. This represents the crossover ratio loss of the i-th actual anchor frame. The weights representing the anchor boxes for positive samples. This represents the preset first modulation factor.

[0101] S405 calculates the classification loss based on the predicted probability, the actual class, the probability of matching the predicted probability with the actual class, the focus loss parameter, and the total number of anchor boxes.

[0102]

[0103]

[0104]

[0105] in, It is the predicted probability corresponding to the i-th predicted anchor box. It is the actual category corresponding to the i-th predicted anchor box. It is the preset second modulation factor. This represents the probability that the predicted probability corresponding to the i-th predicted anchor box matches the actual category corresponding to the i-th predicted anchor box. This represents the focus loss parameter that is dynamically adjusted.

[0106] S406. Calculate the distribution loss based on the total number of anchor frames, the total number of actual categories, the predicted probability, and the actual category corresponding to the predicted probability.

[0107]

[0108] in, This represents the distribution loss, where C is the total number of actual classes. It is the actual category of the i-th sample. It is the predicted probability that the i-th sample belongs to category c. It is a balancing factor used to adjust the weights between positive and negative samples. It is a focusing parameter used to control the degree of attention given to difficult samples.

[0109] S407, based on the sum of crossover ratio regression loss, classification loss and distribution loss, trains the initial detection model to obtain the target detection model.

[0110] The total loss function (Loss) is as follows:

[0111]

[0112] In this embodiment, an initial detection model is trained based on the sum of cross-union regression loss, classification loss, and distribution loss to obtain a target detection model, which can improve the detection accuracy of the target detection model.

[0113] In distribution network operation target detection, the DF-YOLO model, i.e., the target detection model, improves the average accuracy by 1.4% compared to the benchmark model. It also significantly enhances the detection capability for small targets. Compared to the benchmark model, the DF-YOLO model improves the detection accuracy of connectors by 5.1%. This demonstrates that the bidirectional path multi-scale feature deep fusion module proposed in this invention effectively integrates multi-scale features, helping the model focus on small targets. Tables 1 and 2 below show the accuracy comparison on the distribution network operation target detection dataset. Table 2 compares the Map50 accuracy of different distribution network operation target detection methods in the dataset.

[0114] Table 1

[0115]

[0116] Table 2

[0117]

[0118] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0119] Based on the same inventive concept, this application also provides an electrical component detection device for poles and towers to implement the above-described method for detecting electrical components on poles and towers. The solution provided by this device is similar to the solution described in the above-described method. Therefore, the specific limitations of one or more embodiments of the electrical component detection device for poles and towers provided below can be found in the limitations of the method for detecting electrical components on poles and towers described above, and will not be repeated here.

[0120] In one exemplary embodiment, such as Figure 5 As shown, Figure 5 This is a schematic diagram of an electrical component detection device on a pole in one embodiment. The electrical component detection device 500 includes:

[0121] The first acquisition module 501 is used to acquire detection images of power line towers;

[0122] The detection module 502 is used to obtain the detection results of electrical components on the tower based on the detection image and the target detection model. The target detection model is obtained by training an initial detection model. The initial detection model is a model obtained by replacing at least the first stitching module in the neck network of the YOLOv11 single-stage real-time target detection algorithm using a deep feature fusion module. The first stitching module is a module connected to the first upsampling module in the neck network. The neck network includes a first upsampling module and a second upsampling module. The first upsampling module is the next upsampling module of the second upsampling module. The deep feature fusion module includes a first merging module, a pooling module, a weight acquisition module, and a second merging module. The weight acquisition module includes a first weight acquisition module and a second weight acquisition module.

[0123] The first merging module is used to merge the first feature map and the second feature map to obtain the first merged feature map. The first feature map is a feature map obtained by upsampling the feature map from the first resolution feature map, and the second feature map is a second resolution feature map. The resolution of the first resolution feature map is smaller than the resolution of the second resolution feature map.

[0124] The pooling module is used to obtain a target pooled feature map based on the first merged feature map, the first resolution feature map, and the second resolution feature map.

[0125] The first weight acquisition module is used to determine the first weight corresponding to the first resolution feature map based on the target pooling feature map;

[0126] The second weight acquisition module is used to determine the second weights corresponding to the second resolution feature map based on the target pooling feature map.

[0127] The second merging module is used to multiply the first weight with the first feature map to obtain the first target feature map, and to multiply the second weight with the second feature map to obtain the second target feature map, and to merge the first target feature map and the second target feature map to obtain the second merged feature map.

[0128] In an exemplary embodiment, the pooling module includes a max pooling module and an average pooling module, and the target pooling feature map includes a first pooling feature map, a second pooling feature map, a third pooling feature map, a fourth pooling feature map, a fifth pooling feature map, and a sixth pooling feature map.

[0129] The max pooling module is used to obtain a first pooling feature map corresponding to the first merged feature map, a second pooling feature map corresponding to the first feature map, and a third pooling feature map corresponding to the second feature map based on the first merged feature map, the first resolution feature map, and the second resolution feature map.

[0130] The average pooling module is used to obtain a fourth pooling feature map corresponding to the first merged feature map, a fifth pooling feature map corresponding to the first feature map, and a sixth pooling feature map corresponding to the second feature map based on the first merged feature map, the first resolution feature map, and the second resolution feature map.

[0131] In an exemplary embodiment, the deep feature fusion module further includes a first convolution module, which is used to perform convolution processing on the first merged feature map to obtain a first convolution feature map.

[0132] The max pooling module is used to perform max pooling on the first convolutional feature map, the first feature map, and the second feature map to obtain a first pooled feature map corresponding to the first merged feature map, a second pooled feature map corresponding to the first feature map, and a third pooled feature map corresponding to the second feature map.

[0133] The average pooling module is used to perform average pooling on the first convolutional feature map, the first feature map, and the second feature map to obtain the fourth pooling feature map corresponding to the first convolutional feature map, the fifth pooling feature map corresponding to the first feature map, and the sixth pooling feature map corresponding to the second feature map.

[0134] In one exemplary embodiment, the deep feature fusion module further includes a third merging module;

[0135] The third merging module is used to merge the first pooling feature map, the second pooling feature map, the third pooling feature map, the fourth pooling feature map, the fifth pooling feature map, and the sixth pooling feature map to obtain the third merged feature map.

[0136] The first weight acquisition module is used to perform convolution processing on the third merged feature map to obtain the second convolution feature map, and determine the first weight based on the second convolution feature map;

[0137] The second weight acquisition module is used to perform convolution processing on the third merged feature map to obtain the third convolution feature map, and to determine the second weight based on the third convolution feature map.

[0138] In an exemplary embodiment, the initial detection model is a model obtained by replacing the first splicing module with the first deep feature fusion module and replacing the second splicing module in the neck network with the second deep feature fusion module. The output channels of the target C3k2 module and the target convolutional layer in the initial detection model are modified to 512. The second splicing module is the splicing module in YOLOv11 that connects to the convolutional layer corresponding to the target convolutional layer.

[0139] The target C3k2 module is connected to the first deep feature fusion module, and the feature map output by the first deep feature fusion module is the input of the target C3k2 module. The target convolutional layer is a convolutional layer connected to the target C3k2 module.

[0140] In one exemplary embodiment, the electrical component detection device 500 further includes:

[0141] The second acquisition module is used to acquire a sample image set of the tower;

[0142] The prediction module is used to input sample images from the sample image set into the initial detection model to obtain the predicted anchor boxes in the sample images, as well as the predicted probability that the target in the predicted anchor box belongs to the actual category of the target.

[0143] The first calculation module is used to calculate the actual anchor frame based on the predicted anchor frame and the actual anchor frame of the target. loss;

[0144] The first determining module is used to determine all the actual anchor boxes corresponding to the sample image set. The crossover ratio regression loss is determined by the loss and the total number of all actual anchor frames;

[0145] The second calculation module is used to calculate the classification loss based on the predicted probability, the actual class, the probability of matching the predicted probability with the actual class, the focus loss parameter, and the total number of anchor boxes.

[0146] The third calculation module is used to calculate the distribution loss based on the total number of anchor frames, the total number of actual categories, the predicted probability, and the actual category corresponding to the predicted probability.

[0147] The training module is used to train the initial detection model based on the sum of the crossover ratio regression loss, classification loss, and distribution loss, thus obtaining the target detection model.

[0148] Each module in the aforementioned electrical component detection device on the tower can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0149] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a method for detecting electrical components on a pole. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0150] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0151] In one exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of any of the method embodiments described above. The technical principles and effects are similar and will not be repeated here.

[0152] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of any of the above method embodiments. The technical principles and effects are similar and will not be repeated here.

[0153] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of any of the method embodiments described above. Its technical principles and effects are similar and will not be repeated here.

[0154] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0155] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0156] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0157] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for testing electrical components on a power pole, characterized in that, The method includes: Acquire detection images of power line towers; Based on the detected image and the target detection model, the detection results of the electrical components on the tower are obtained. The target detection model is obtained by training an initial detection model. The initial detection model is a model obtained by using a deep feature fusion module to replace at least the first stitching module in the neck network of the YOLOv11 single-stage real-time target detection algorithm. The first stitching module is a module connected to the first upsampling module in the neck network. The neck network includes the first upsampling module and the second upsampling module. The first upsampling module is the next upsampling module of the second upsampling module. The deep feature fusion module includes a first merging module, a pooling module, a weight acquisition module, and a second merging module. The weight acquisition module includes a first weight acquisition module and a second weight acquisition module. The first merging module is used to merge the first feature map and the second feature map to obtain a first merged feature map. The first feature map is a feature map obtained by upsampling the feature map from the first resolution feature map, and the second feature map is a second resolution feature map. The resolution of the first resolution feature map is smaller than the resolution of the second resolution feature map. The pooling module is used to obtain a target pooling feature map based on the first merged feature map, the first resolution feature map, and the second resolution feature map; The first weight acquisition module is used to determine the first weight corresponding to the first resolution feature map based on the target pooling feature map; The second weight acquisition module is used to determine the second weight corresponding to the second resolution feature map based on the target pooling feature map; The second merging module is used to multiply the first weight by the first feature map to obtain a first target feature map, and to multiply the second weight by the second feature map to obtain a second target feature map, and to merge the first target feature map and the second target feature map to obtain a second merged feature map.

2. The method according to claim 1, characterized in that, The pooling module includes a max pooling module and an average pooling module, and the target pooling feature map includes a first pooling feature map, a second pooling feature map, a third pooling feature map, a fourth pooling feature map, a fifth pooling feature map, and a sixth pooling feature map. The max pooling module is used to obtain, based on the first merged feature map, the first resolution feature map, and the second resolution feature map, a first pooling feature map corresponding to the first merged feature map, a second pooling feature map corresponding to the first feature map, and a third pooling feature map corresponding to the second feature map; The average pooling module is used to obtain, based on the first merged feature map, the first resolution feature map, and the second resolution feature map, the fourth pooling feature map corresponding to the first merged feature map, the fifth pooling feature map corresponding to the first feature map, and the sixth pooling feature map corresponding to the second feature map.

3. The method according to claim 2, characterized in that, The deep feature fusion module further includes a first convolution module, which is used to perform convolution processing on the first merged feature map to obtain a first convolution feature map. The max pooling module is used to perform max pooling processing on the first convolutional feature map, the first feature map, and the second feature map to obtain the first pooled feature map corresponding to the first merged feature map, the second pooled feature map corresponding to the first feature map, and the third pooled feature map corresponding to the second feature map. The average pooling module is used to perform average pooling processing on the first convolutional feature map, the first feature map, and the second feature map to obtain the fourth pooling feature map corresponding to the first convolutional feature map, the fifth pooling feature map corresponding to the first feature map, and the sixth pooling feature map corresponding to the second feature map.

4. The method according to claim 2 or 3, characterized in that, The deep feature fusion module also includes a third merging module; The third merging module is used to merge the first pooling feature map, the second pooling feature map, the third pooling feature map, the fourth pooling feature map, the fifth pooling feature map, and the sixth pooling feature map to obtain a third merged feature map; The first weight acquisition module is used to perform convolution processing on the third merged feature map to obtain a second convolutional feature map, and determine the first weight based on the second convolutional feature map; The second weight acquisition module is used to perform convolution processing on the third merged feature map to obtain a third convolutional feature map, and determine the second weight based on the third convolutional feature map.

5. The method according to claim 1, characterized in that, The initial detection model is a model obtained by replacing the first splicing module with the first deep feature fusion module and replacing the second splicing module in the neck network with the second deep feature fusion module. The output channels of the target C3k2 module and the target convolutional layer in the initial detection model are modified to 512. The second splicing module is the splicing module in YOLOv11 that connects to the convolutional layer corresponding to the target convolutional layer. The target C3k2 module is connected to the first deep feature fusion module, and the feature map output by the first deep feature fusion module is the input of the target C3k2 module. The target convolutional layer is a convolutional layer connected to the target C3k2 module.

6. The method according to any one of claims 1-3, characterized in that, The method further includes: Obtain a sample image set of the tower; The sample images in the sample image set are input into the initial detection model to obtain the predicted anchor boxes in the sample images and the predicted probability that the target in the predicted anchor box belongs to the actual category of the target. Based on the predicted anchor frame and the actual anchor frame of the target, calculate the actual anchor frame. loss; Based on all the actual anchor frames corresponding to the sample image set The crossover ratio regression loss is determined by the loss and the total number of all actual anchor frames; The classification loss is calculated based on the predicted probability, the actual category, the probability that the predicted probability matches the actual category, the focus loss parameter, and the total number of anchor boxes. Calculate the distribution loss based on the total number of anchor frames, the total number of actual categories, the predicted probability, and the actual category corresponding to the predicted probability. The initial detection model is trained based on the sum of the cross-union regression loss, the classification loss, and the distribution loss to obtain the target detection model.

7. A testing device for electrical components on a pole, characterized in that, The device includes: The first acquisition module is used to acquire detection images of power line towers; The detection module is used to obtain the detection results of electrical components on the tower based on the detected image and the target detection model. The target detection model is obtained by training an initial detection model. The initial detection model is a model obtained by using a deep feature fusion module to replace at least the first stitching module in the neck network of the YOLOv11 single-stage real-time target detection algorithm. The first stitching module is a module connected to the first upsampling module in the neck network. The neck network includes the first upsampling module and the second upsampling module, and the first upsampling module is the next upsampling module of the second upsampling module. The deep feature fusion module includes a first merging module, a pooling module, a weight acquisition module, and a second merging module. The weight acquisition module includes a first weight acquisition module and a second weight acquisition module. The first merging module is used to merge the first feature map and the second feature map to obtain a first merged feature map. The first feature map is a feature map obtained by upsampling the feature map from the first resolution feature map, and the second feature map is a second resolution feature map. The resolution of the first resolution feature map is smaller than the resolution of the second resolution feature map. The pooling module is used to obtain a target pooling feature map based on the first merged feature map, the first resolution feature map, and the second resolution feature map; The first weight acquisition module is used to determine the first weight corresponding to the first resolution feature map based on the target pooling feature map; The second weight acquisition module is used to determine the second weight corresponding to the second resolution feature map based on the target pooling feature map; The second merging module is used to multiply the first weight by the first feature map to obtain a first target feature map, and to multiply the second weight by the second feature map to obtain a second target feature map, and to merge the first target feature map and the second target feature map to obtain a second merged feature map.

8. An electrical component testing device, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.