Power distribution line foreign matter detection method and device, computer device, readable storage medium and program product

By combining multi-scale feature extraction and focus modulation modules with a segmentation network, a dual-task collaborative network is constructed, which solves the problem of high false negative rate in existing foreign object detection methods for power distribution lines and achieves high-precision detection of small-scale foreign objects.

CN123160939APending Publication Date: 2026-11-24GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611242113.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing methods for detecting foreign objects in power distribution lines have a high rate of missed detection in complex backgrounds, especially for small-scale, low-contrast foreign objects. Furthermore, existing technologies do not fully utilize prior information about linear structures, making it difficult to achieve high-precision foreign object detection.

Method used

By combining a multi-scale feature extraction network with a focus modulation module and a segmentation network, a dual-task collaborative network is constructed through feature fusion and network region segmentation. This enhances the feature focusing of the network region and the dynamic reduction of background interference, thereby reducing the false negative rate.

Benefits of technology

It significantly improves the accuracy of foreign object detection in power distribution lines, reduces the false negative rate, and achieves efficient detection of small-scale foreign objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160939A_ABST
    Figure CN123160939A_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer equipment, readable storage medium, and program product for detecting foreign objects in power distribution lines. The method includes: extracting multi-scale features from an image to be detected using a multi-scale feature extraction network to obtain multiple feature maps of different scales, wherein the image to be detected includes power distribution lines; fusing the multiple feature maps across scales using a feature fusion network and a focus modulation module to obtain multiple feature modulation maps of different scales; segmenting the smallest-scale feature modulation map among the multiple feature modulation maps using a segmentation network to obtain multiple wire mesh mask maps of different scales; fusing each wire mesh mask map with the feature modulation map of the corresponding scale to obtain multiple fused feature maps; and performing foreign object detection processing on the multiple fused feature maps using a detection network to obtain the foreign object detection result. This method can reduce the false negative rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, readable storage medium, and program product for detecting foreign objects in power distribution lines. Background Technology

[0002] With the deepening of smart grid construction, the safety inspection of distribution lines has become a key link in ensuring the stable operation of the power system. Traditional manual inspection methods rely on personnel climbing towers or conducting ground inspections, which are not only inefficient and costly, but also subject to complex terrain, inclement weather, and the risks of working at heights, making it difficult to achieve large-scale, high-frequency full-coverage monitoring.

[0003] In recent years, visible light image inspection technology based on drones and fixed cameras has developed rapidly and been widely applied in the power operation and maintenance field. Drones can fly autonomously along power lines, carrying high-definition cameras to perform centimeter-resolution imaging of key components such as conductors, insulator strings, and hardware, achieving non-contact, all-weather data collection. Combined with edge computing and AI (Artificial Intelligence) analysis platforms, inspection images can be transmitted back in real time and processed automatically, significantly improving the speed and intelligence of operation and maintenance response. However, current methods for detecting foreign objects on power distribution lines still suffer from a high rate of missed detections. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, readable storage medium, and program product for detecting foreign objects in power distribution lines that can reduce the false negative rate, in order to address the above-mentioned technical problems.

[0005] In a first aspect, this application provides a method for detecting foreign objects in power distribution lines. The method includes: extracting multi-scale features from an image to be detected using a multi-scale feature extraction network to obtain multiple feature maps of different scales, wherein the image to be detected includes power distribution lines; performing cross-scale feature fusion on the multiple feature maps using a feature fusion network and a focus modulation module to obtain multiple feature modulation maps of different scales; performing wire mesh region segmentation on the smallest-scale feature modulation map among the multiple feature modulation maps using a segmentation network to obtain multiple wire mesh mask maps of different scales; fusing each wire mesh mask map with the feature modulation map of the corresponding scale to obtain multiple fused feature maps; and performing foreign object detection processing on the multiple fused feature maps using a detection network to obtain a foreign object detection result.

[0006] In one embodiment, a segmentation network is used to perform wire mesh region segmentation on the smallest-scale feature modulation map in multiple feature modulation maps to obtain multiple wire mesh mask maps of different scales. This includes: performing wire mesh region segmentation on the smallest-scale feature modulation map in multiple feature modulation maps using a segmentation network to obtain a probability map; upsampling the probability map to the scale corresponding to each feature modulation map to obtain multiple upsampled probability maps; and normalizing each upsampled probability map to obtain multiple wire mesh mask maps.

[0007] In one embodiment, each net mask image is fused with a feature modulation image of the corresponding scale to obtain multiple fused feature images, including: multiplying each net mask image with a feature modulation image of the corresponding scale element-wise to obtain multiple fused feature images.

[0008] In one embodiment, the feature fusion network includes multiple feature fusion layers and multiple focus modulation modules, with each feature fusion layer corresponding to one of the multiple focus modulation modules. The feature fusion network and focus modulation modules are used to perform cross-scale feature fusion on multiple feature maps to obtain multiple feature modulation maps of different scales. This includes: inputting multiple feature maps into the corresponding feature fusion layers respectively, and using the corresponding focus modulation modules to perform feature modulation on the output of the feature fusion layers to obtain multiple feature modulation maps of different scales.

[0009] In one embodiment, a multi-scale feature extraction network, a feature fusion network, a focus modulation module, a segmentation network, and a detection network constitute a foreign object detection model for power distribution lines. The training method for the foreign object detection model for power distribution lines includes: inputting sample images into the model to be trained to obtain sample wire mesh mask images and sample foreign object detection results; obtaining a detection task loss based on the sample foreign object detection results and foreign object detection labels of the sample images; obtaining a segmentation task loss based on the sample wire mesh mask images and wire mesh mask labels of the sample images; training the model to be trained based on the detection task loss and the segmentation task loss, and obtaining the foreign object detection model for power distribution lines after training is completed.

[0010] In one embodiment, the sample foreign object detection result includes a foreign object category and a foreign object bounding box, and the foreign object detection label includes a foreign object category label and a foreign object bounding box label; based on the sample foreign object detection result and the foreign object detection label of the sample image, the detection task loss is obtained, including: obtaining a classification loss based on the foreign object category and the foreign object category label; obtaining a bounding box regression loss based on the foreign object bounding box and the foreign object bounding box label; and obtaining the detection task loss based on the classification loss and the bounding box regression loss.

[0011] Secondly, this application also provides a foreign object detection device for power distribution lines, the device comprising:

[0012] The feature extraction module is used to extract features from the image to be detected using a multi-scale feature extraction network to obtain feature maps of multiple different scales. The image to be detected includes power distribution lines.

[0013] The feature fusion module is used to perform cross-scale feature fusion on multiple feature maps through the feature fusion network and the focus modulation module to obtain multiple feature modulation maps of different scales.

[0014] The segmentation module is used to perform wire mesh region segmentation on the smallest-scale feature modulation map of multiple feature modulation maps through a segmentation network to obtain wire mesh mask maps of different scales.

[0015] The foreign object detection module is used to fuse each wire mesh mask map with the feature modulation map of the corresponding scale to obtain multiple fused feature maps, and then perform foreign object detection processing on the multiple fused feature maps through the detection network to obtain the foreign object detection result.

[0016] In one embodiment, the segmentation module is specifically used to perform wire mesh region segmentation on the smallest-scale feature modulation map of multiple feature modulation maps through a segmentation network to obtain a probability map; upsample the probability map to the scale corresponding to each feature modulation map to obtain multiple upsampled probability maps; and normalize each upsampled probability map to obtain multiple wire mesh mask maps.

[0017] In one embodiment, the foreign object detection module is specifically used to multiply each wire mesh mask map element-wise with the feature modulation map of the corresponding scale to obtain multiple fused feature maps.

[0018] In one embodiment, the feature fusion network includes multiple feature fusion layers and multiple focus modulation modules, with each feature fusion layer corresponding to one of the multiple focus modulation modules. Specifically, the feature fusion module is used to input multiple feature maps into the corresponding feature fusion layer and perform feature modulation on the output of the feature fusion layer through the corresponding focus modulation module to obtain multiple feature modulation maps of different scales.

[0019] In one embodiment, a multi-scale feature extraction network, a feature fusion network, a focus modulation module, a segmentation network, and a detection network constitute a foreign object detection model for power distribution lines. The device also includes a training module for inputting sample images into the model to be trained to obtain sample wire mesh mask images and sample foreign object detection results; obtaining a detection task loss based on the sample foreign object detection results and foreign object detection labels of the sample images; obtaining a segmentation task loss based on the sample wire mesh mask images and wire mesh mask labels of the sample images; and training the model to be trained based on the detection task loss and the segmentation task loss to obtain the foreign object detection model for power distribution lines after training is completed.

[0020] In one embodiment, the sample foreign object detection result includes a foreign object category and a foreign object bounding box, and the foreign object detection label includes a foreign object category label and a foreign object bounding box label; the training module is specifically used to obtain a classification loss based on the foreign object category and the foreign object category label; obtain a bounding box regression loss based on the foreign object bounding box and the foreign object bounding box label; and obtain a detection task loss based on the classification loss and the bounding box regression loss.

[0021] 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 method steps described in any one of the first aspects above.

[0022] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method steps described in any one of the first aspects above.

[0023] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the method steps described in any one of the first aspects above.

[0024] The aforementioned method, apparatus, computer equipment, readable storage medium, and program product for detecting foreign objects in power distribution lines extract features from the image to be detected using a multi-scale feature extraction network to obtain multiple feature maps of different scales. Then, a feature fusion network and a focus modulation module perform cross-scale feature fusion on these multiple feature maps to obtain multiple feature modulation maps of different scales. Next, a segmentation network performs wire mesh region segmentation on the smallest-scale feature modulation map among the multiple feature modulation maps to obtain multiple wire mesh mask maps of different scales. Each wire mesh mask map is then fused with the corresponding scale feature modulation map to obtain multiple fused feature maps. Finally, a detection network performs foreign object detection processing on these multiple fused feature maps to obtain the foreign object detection result. This application, through the focus modulation module and segmentation network, achieves feature focusing on the wire mesh region and dynamic reduction of background interference, thereby reducing the false negative rate. Attached Figure Description

[0025] 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.

[0026] Figure 1 This is an application environment diagram of the foreign object detection method for power distribution lines in one embodiment;

[0027] Figure 2 This is a flowchart illustrating a foreign object detection method for power distribution lines in one embodiment;

[0028] Figure 3 This is a schematic diagram illustrating the principle of foreign object detection in a power distribution line in one embodiment;

[0029] Figure 4 This is a schematic diagram of the focus modulation module in one embodiment;

[0030] Figure 5 This is a flowchart illustrating the training method for a foreign object detection model in a power distribution line in one embodiment.

[0031] Figure 6 This is a structural block diagram of a foreign object detection device for power distribution lines in one embodiment;

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

[0033] 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.

[0034] 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.

[0035] With the deepening of smart grid construction, the safety inspection of distribution lines has become a crucial link in ensuring the stable operation of the power system. Traditional manual inspection methods rely on personnel climbing towers or conducting ground inspections, which are not only inefficient and costly, but also limited by complex terrain, inclement weather, and the risks of high-altitude operations, making it difficult to achieve large-scale, high-frequency, full-coverage monitoring. In recent years, visible light image inspection technology based on drones and fixed cameras has rapidly developed and been widely applied in the field of power operation and maintenance. Drones can fly autonomously along the lines, carrying high-definition cameras to perform centimeter-resolution imaging of key parts such as conductors, insulator strings, and hardware, achieving non-contact, all-weather data collection. Combined with edge computing and AI analysis platforms, inspection images can be transmitted back in real time and processed automatically, significantly improving the speed and intelligence of operation and maintenance response.

[0036] Existing methods for detecting foreign objects in power distribution lines are mainly based on simple target detection models, which suffer from high false negative rates and frequent false alarms in complex environments, especially in terms of insufficient detection capability for small-scale, low-contrast foreign objects. Specifically, existing technologies often fail to fully utilize the prior information of the linear structure of power distribution lines, causing the model's focus area to easily deviate from key positions and making it difficult to effectively suppress various background interferences. In addition, some methods for detecting foreign objects in power distribution lines introduce attention mechanisms or combine semantic segmentation for multi-task learning, but lack spatial guidance for detection features, failing to achieve effective feedback of segmentation results to detection branches, and exhibiting weak feature fusion mechanisms. Furthermore, a single detection task cannot fully exploit the contextual semantics, limiting the model's generalization ability. Therefore, although UAV inspections improve efficiency, insufficient algorithm accuracy still requires extensive manual verification, resulting in high maintenance costs. In summary, existing methods for detecting foreign objects in power distribution lines have significant shortcomings in feature representation, spatial focusing, and task collaboration, making it difficult to meet the engineering application requirements of high accuracy and high stability in complex scenarios.

[0037] Therefore, it is necessary to propose an effective technical license to solve the above-mentioned technical problems. The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments.

[0038] The foreign object detection method for power distribution lines provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located on the cloud or other network servers. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, and low-altitude aircraft. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0039] In one exemplary embodiment, such as Figure 2 As shown, a method for detecting foreign objects in power distribution lines is provided, which can be applied to... Figure 1 Taking the terminal in the example, the explanation includes the following steps 201 to 204. Wherein:

[0040] Step 201: Multi-scale feature extraction is performed on the image to be detected using a multi-scale feature extraction network to obtain multiple feature maps of different scales. The image to be detected includes power distribution lines.

[0041] The structure of the multi-scale feature extraction network can be the backbone structure in the YOLOv8 network architecture, such as... Figure 3As shown, the backbone network structure includes the CBS (Convolution-BatchNorm-SiLU) module, the C2f module (CrossStage Partial Network with 2 Convolutional Fusion, a two-layer module with cross-stage feature fusion), and the SPPF (Spatial Pyramid Pooling Fast) module. The CBS module is the basic convolutional module, consisting of convolutional layers (Conv2d), batch normalization layers (BatchNorm2d), and activation functions (SiLU function), mainly used to improve feature extraction efficiency and model performance. The C2f module is a lightweight feature extraction unit, mainly used for deep feature extraction. The SPPF module can perform multi-scale pooling operations on the feature map to extract features at different scales, enhancing the model's adaptability to multi-scale changes in the target.

[0042] In one possible implementation, the image to be detected is input into a multi-scale feature extraction network. The image to be detected is processed sequentially by a first CBS module, a second CBS module, a first C2f module, a third CBS module, a second C2f module, a fourth CBS module, a third C2f module, a fifth CBS module, a fourth C2f module, and an SPPF module to obtain multiple feature maps of different scales. The multiple feature maps of different scales include feature map P3 output by the second C2f module, feature map P4 output by the third C2f module, and feature map P5 output by the SPPF module.

[0043] Step 202: Perform cross-scale feature fusion on multiple feature maps through a feature fusion network and a focus modulation module to obtain multiple feature modulation maps of different scales.

[0044] The feature fusion network can be structured like the neck network in the YOLOv8 network architecture, and the focus modulation module can be an FM (Focal Modulation) module. The neck network includes an upsampling layer, a feature fusion layer, a C2f module, and a CBS module. The FM module can be placed between the feature fusion layer and the C2f module in the neck network, that is, after each feature fusion layer, resulting in an improved neck network. Figure 3As shown, the FM module dynamically fuses local features with global contextual information through a gating mechanism. Specifically, it includes: grouping the input features into channels, where one group is used to extract spatial details, and another group aggregates global information through global average pooling to generate spatial and level-aware gating weights; the spatial and level-aware gating weights are then multiplied element-wise with the backbone features to achieve adaptive enhancement of key regions, thereby improving the feature saliency and discrimination ability of small-scale foreign objects.

[0045] Specifically, the structure of the FM module is as follows: Figure 4 As shown, for a given input feature map X, it is first projected into a new feature space with a linear layer. , represented as ;in, It is the linear layer function expression given the input feature map X. Indicates the image size and number of channels. Image height, Image width, This represents the number of image channels. (Used) ( Layer 1, 2, 3 (depthmarchive convolutions) extract contextual information layer by layer, which is to achieve hierarchical contextualization and output the result. Represented as ;in, For the first The contextualization function of the layer, For activation function, The DWConv deep convolution is used. Global average pooling is applied to the last feature map layer to capture the global contextual information of the entire input, enhancing the completeness of the feature representation. Then, gated aggregation is used to condense the contextual features at different granularities into a single feature vector, i.e., the modulator. Specifically, a lightweight linear transformation is used to obtain spatially and level-aware gate weights, and then a weighted sum is performed through element-wise multiplication to obtain a single feature map of the same size as the input feature X. , can be represented as , ;in, This is a functional expression for the gating weights of space and level awareness. It is the first One channel of the layer. To model the relationship between different channels, another linear layer is used. Obtain the modulator M, denoted as The overall focus modulation, combined with the formulas of interaction and aggregation, integrates local and global contextual information, enhancing the expressive power of features, and is represented as follows: ;in, For query mapping functions, This is an element-wise multiplication operator.

[0046] In one possible implementation, multiple feature modulation maps of different scales include a first feature modulation map, a second feature modulation map, and a third feature modulation map, where the size of the first feature modulation map is larger than the size of the second feature modulation map, and the size of the second feature modulation map is larger than the size of the third feature modulation map. Feature maps P3, P4, and P5 are input into the improved neck network to obtain the first, second, and third feature modulation maps.

[0047] Step 203: Perform wire mesh region segmentation on the smallest-scale feature modulation map of multiple feature modulation maps using a segmentation network to obtain multiple wire mesh mask maps of different scales.

[0048] Among them, segmented network is Figure 3 The wire mesh area is divided into branches.

[0049] In one possible implementation, a segmentation network is used to perform wire mesh region segmentation on the smallest-scale feature modulation map of multiple feature modulation maps to obtain a probability map; the probability map is then upsampled to the scale corresponding to each feature modulation map to obtain multiple upsampled probability maps; and each upsampled probability map is normalized to obtain multiple wire mesh mask maps.

[0050] For example, the segmentation network performs wire mesh region segmentation on the third feature modulation map to obtain a probability map, which is a low-resolution probability map. Then, it uses bilinear interpolation to upsample the map to the spatial size (also known as spatial resolution) corresponding to the first, second, and third feature modulation maps output by the improved neck network, resulting in multiple upsampled probability maps.

[0051] Suppose the probability graph output by the segmentation network is P, and its size is... To compare with the different scale feature maps output by the improved neck network (let's say...). ,in For matching {3,4,5}, an upsampling operation is required. Let the probability map obtained after bilinear interpolation be denoted as . Then we have:

[0052]

[0053] in, and represent the spatial resolution of the feature map of the i-th layer, respectively.

[0054] The upsampled probability map is normalized using Sigmoid to generate a mesh mask image, where the mask value is between 0 and 1, representing the confidence level that each pixel location belongs to a mesh region; let the mesh mask image be M, then:

[0055]

[0056] Step 204: Fuse each wire mesh mask map with the feature modulation map of the corresponding scale to obtain multiple fused feature maps, and perform foreign object detection processing on the multiple fused feature maps through a detection network to obtain foreign object detection results.

[0057] The detection network structure can be the head network structure in the YOLOv8 network architecture, i.e. Figure 3 The target detection branch in [the text].

[0058] In one possible implementation, each mesh mask is element-wise multiplied with the corresponding scale feature modulation map to obtain multiple fused feature maps, thereby achieving spatially guided feature modulation. It is understood that the multiple fused feature maps have different sizes.

[0059] For example, the mesh mask images are multiplied element-wise in the spatial dimension with the corresponding first, second, and third feature modulation images output by the improved neck network. This enhances the feature channels in high-confidence regions and suppresses the feature responses in low-confidence regions, thereby achieving dynamic feature focusing and background interference reduction in the mesh region. Let the feature images at the corresponding scale be... Then, for each layer i, the resulting fused feature map for:

[0060]

[0061] in, This indicates an element-wise multiplication operation.

[0062] The detection network consists of multiple detector heads and multiple fused features. Figure 1 In a one-to-one correspondence, each fused feature map is input into the corresponding detection head to obtain the foreign object detection result.

[0063] In summary, the backbone of the YOLOv8 network remains unchanged, the FM module is integrated into the neck network, and a target detection branch and a wire network region segmentation branch are set in parallel at its output to construct a dual-task collaborative network.

[0064] The aforementioned method for detecting foreign objects in power distribution lines extracts features from the image to be detected using a multi-scale feature extraction network, obtaining multiple feature maps at different scales. A feature fusion network and a focus modulation module then perform cross-scale feature fusion on these feature maps, resulting in multiple feature modulation maps at different scales. Next, a segmentation network segments the smallest-scale feature modulation map among these feature modulation maps to obtain multiple network mask maps at different scales. These network masks are then fused with the corresponding scale feature modulation maps to obtain multiple fused feature maps. Finally, a detection network performs foreign object detection processing on these fused feature maps to obtain the foreign object detection result. This application utilizes the focus modulation module and segmentation network to achieve feature focusing on the network region and dynamic reduction of background interference, thereby reducing the false negative rate.

[0065] In an exemplary embodiment, the feature fusion network includes multiple feature fusion layers and multiple focus modulation modules, with each feature fusion layer corresponding to one of the multiple focus modulation modules. The feature fusion network and focus modulation modules are used to perform cross-scale feature fusion on multiple feature maps to obtain multiple feature modulation maps of different scales. This includes: inputting the multiple feature maps into the corresponding feature fusion layers respectively, and using the corresponding focus modulation modules to perform feature modulation on the output of the feature fusion layers to obtain multiple feature modulation maps of different scales.

[0066] In one possible implementation, continue to refer to Figure 3 Feature map P5 is input to the first upsampling layer and the fourth feature fusion layer, feature map P4 is input to the first feature fusion layer, and feature map P3 is input to the second feature fusion layer. The first upsampling layer upsamples feature map P5 and inputs it to the first feature fusion layer. The first feature fusion layer concatenates the output of the first upsampling layer with feature map P4 and inputs it to the first FM module. The first FM module modulates the output of the first feature fusion layer and inputs it to the fifth C2f module. The fifth C2f module processes the output of the first FM module and inputs it to the second upsampling layer and the third feature fusion layer respectively. The second upsampling layer upsamples the output of the fifth C2f module and inputs it to the second feature fusion layer. The second feature fusion layer concatenates the output of the second upsampling layer with feature map P3 and inputs it to the second FM module. The second FM module modulates the output of the second feature fusion layer and inputs it to the sixth C2f module. The sixth C2f module processes the output of the second FM module to obtain the first feature modulation map.

[0067] The first feature modulation map is input into the sixth CBS module. The sixth CBS module performs convolution processing on the first feature modulation map and then inputs it into the third feature fusion layer. The third feature fusion layer concatenates the output of the sixth CBS module and the output of the fifth C2f module and then inputs it into the third FM module. The third FM module performs feature modulation on the output of the third feature fusion layer and then inputs it into the seventh C2f module. The seventh C2f module processes the output of the third FM module to obtain the second feature modulation map.

[0068] The second feature modulation map is input into the seventh CBS module. The seventh CBS module performs convolution processing on the second feature modulation map and then inputs it into the fourth feature fusion layer. The fourth feature fusion layer concatenates the output of the seventh CBS module with feature map P5 and then inputs it into the fourth FM module. The fourth FM module performs feature modulation on the output of the fourth feature fusion layer and then inputs it into the eighth C2f module. The eighth C2f module processes the output of the fourth FM module to obtain the third feature modulation map.

[0069] In one exemplary embodiment, such as Figure 5 The diagram illustrates a flowchart of a training method for a foreign object detection model for power distribution lines. The foreign object detection model for power distribution lines comprises a multi-scale feature extraction network, a feature fusion network, a focus modulation module, a segmentation network, and a detection network. The training method for the foreign object detection model includes steps 501 to 504, wherein:

[0070] Step 501: Input the sample image into the model to be trained to obtain the sample mesh mask and the sample foreign object detection results.

[0071] It is understandable that the structure of the model to be trained is the same as that of the foreign object detection model for power distribution lines. The sample images can be obtained by processing the initial sample images.

[0072] In one possible implementation, a drone equipped with a visible light camera or a fixed inspection camera is used to acquire visible light inspection images of power distribution lines under different lighting, weather, and angle conditions, thus obtaining initial sample images. These initial sample images are then processed, such as removing blurry, overexposed, or severely occluded low-quality images to improve the overall quality of the dataset; foreign object labeling and mesh region labeling are performed on the retained images. Annotation tools are used to draw bounding boxes for foreign objects such as bird nests, balloons, and kites in the images and label their categories, thus achieving foreign object labeling and obtaining foreign object bounding box labels and foreign object category labels; pixel-level annotation is performed on the mesh regions, generating binary masks of the mesh regions as segmentation supervision signals, thus achieving mesh region labeling and obtaining mesh mask labels; the annotated images and corresponding label files are then proportionally divided into training and test sets. Sample images from the training set are input into the model to be trained to obtain sample mesh mask maps and sample foreign object detection results.

[0073] Step 502: Based on the foreign object detection results of the sample and the foreign object detection labels of the sample images, the detection task loss is obtained.

[0074] The sample foreign object detection results include the foreign object category and the foreign object bounding box, and the foreign object detection labels include the foreign object category label and the foreign object bounding box label.

[0075] In one possible implementation, a classification loss is obtained based on the foreign object category and the foreign object category label; a bounding box regression loss is obtained based on the foreign object bounding box and the foreign object bounding box label; and a detection task loss is obtained based on the classification loss and the bounding box regression loss.

[0076] Step 503: Based on the sample mesh mask map and the mesh mask label of the sample image, obtain the segmentation task loss.

[0077] Step 504: Train the model to be trained based on the detection task loss and the segmentation task loss, and obtain the foreign object detection model for power distribution lines after training is completed.

[0078] In summary, the loss function is set as the joint loss function L. total That is, the detection task loss L det And the task loss L seg The weighted sum is specifically defined as:

[0079] L total =α·L det +β·L seg

[0080] Among them, the detection task loss L det It is composed of Focal Loss classification loss and Wise-IoU bounding box regression loss, denoted as L det =λ cls ·L Focal +λ reg ·L Wise-IoU The loss calculation for each detection task corresponds to three detection heads. Each detection head contains two independent branches: the output of its classification branch is used to calculate the Focal Loss, and the output of its regression branch is used to calculate the Wise-IoU; where λ cls and λ reg These are the weighting coefficients for classification loss and regression loss, respectively; α and β are non-negative weighting coefficients used to balance the contribution of each loss to the total loss.

[0081] The sample images in the training set are input into the model to be trained for end-to-end training. The network parameters are optimized through backpropagation until the model converges, and the optimal detection model is obtained, which is the foreign object detection model for power distribution lines.

[0082] The test set images are input into the trained optimal detection model to obtain preliminary detection results. The optimal detection box is selected by non-maximum suppression (NMS), and the detection box and category label are drawn on the original image to complete the automatic detection of foreign objects in the power distribution line.

[0083] This application constructs a dual-task collaborative network, adds a wire mesh region segmentation branch and generates a wire mesh mask map, performs spatially guided modulation on multi-scale features, combines the FM module in the neck network to fuse local and global context information, and designs a joint loss function with segmentation supervision to achieve end-to-end optimization. This effectively suppresses interference from complex backgrounds, enhances the feature focusing and discrimination ability for small-scale foreign objects, significantly improves detection accuracy, and thus reduces the false negative rate.

[0084] 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.

[0085] Based on the same inventive concept, this application also provides a foreign object detection device for power distribution lines to implement the aforementioned method for detecting foreign objects in power distribution lines. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the foreign object detection device for power distribution lines provided below can be found in the limitations of the method for detecting foreign objects in power distribution lines described above, and will not be repeated here.

[0086] In one exemplary embodiment, such as Figure 6 As shown, a foreign object detection device for power distribution lines is provided. The foreign object detection device 600 includes: a feature extraction module 601, a feature fusion module 602, a segmentation module 603, and a foreign object detection module 604, wherein:

[0087] The feature extraction module 601 is used to perform multi-scale feature extraction on the image to be detected through a multi-scale feature extraction network to obtain multiple feature maps of different scales. The image to be detected includes power distribution lines.

[0088] The feature fusion module 602 is used to perform cross-scale feature fusion on multiple feature maps through a feature fusion network and a focus modulation module to obtain multiple feature modulation maps of different scales.

[0089] The segmentation module 603 is used to perform wire mesh region segmentation on the smallest-scale feature modulation map of multiple feature modulation maps through a segmentation network to obtain multiple wire mesh mask maps of different scales.

[0090] The foreign object detection module 604 is used to fuse each wire mesh mask map with the feature modulation map of the corresponding scale to obtain multiple fused feature maps, and to perform foreign object detection processing on the multiple fused feature maps through the detection network to obtain the foreign object detection result.

[0091] In one embodiment, the segmentation module 603 is specifically used to perform wire mesh region segmentation on the smallest scale feature modulation map of multiple feature modulation maps through a segmentation network to obtain a probability map; upsample the probability map to the scale corresponding to each feature modulation map to obtain multiple upsampled probability maps; and normalize each upsampled probability map to obtain multiple wire mesh mask maps.

[0092] In one embodiment, the foreign object detection module 604 is specifically used to multiply each wire mesh mask map element-wise with the feature modulation map of the corresponding scale to obtain multiple fused feature maps.

[0093] In one embodiment, the feature fusion network includes multiple feature fusion layers and multiple focus modulation modules, with each feature fusion layer corresponding to one of the multiple focus modulation modules. The feature fusion module 602 is specifically used to input multiple feature maps into the corresponding feature fusion layers respectively, and to perform feature modulation on the output results of the feature fusion layers through the corresponding focus modulation modules to obtain multiple feature modulation maps of different scales.

[0094] In one embodiment, a multi-scale feature extraction network, a feature fusion network, a focus modulation module, a segmentation network, and a detection network constitute a foreign object detection model for power distribution lines. The device also includes a training module for inputting sample images into the model to be trained to obtain sample wire mesh mask images and sample foreign object detection results; obtaining a detection task loss based on the sample foreign object detection results and foreign object detection labels of the sample images; obtaining a segmentation task loss based on the sample wire mesh mask images and wire mesh mask labels of the sample images; and training the model to be trained based on the detection task loss and the segmentation task loss to obtain the foreign object detection model for power distribution lines after training is completed.

[0095] In one embodiment, the sample foreign object detection result includes a foreign object category and a foreign object bounding box, and the foreign object detection label includes a foreign object category label and a foreign object bounding box label; the training module is specifically used to obtain a classification loss based on the foreign object category and the foreign object category label; obtain a bounding box regression loss based on the foreign object bounding box and the foreign object bounding box label; and obtain a detection task loss based on the classification loss and the bounding box regression loss.

[0096] Each module in the aforementioned foreign object detection device for power distribution lines can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0097] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As 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 foreign objects in power distribution lines. 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.

[0098] Those skilled in the art will understand that Figure 7The 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.

[0099] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method steps described in any of the above method embodiments.

[0100] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method steps described in any of the above method embodiments.

[0101] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the method steps described in any of the above method embodiments.

[0102] 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.

[0103] 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.

[0104] 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.

[0105] 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 detecting foreign objects in power distribution lines, characterized in that, include: A multi-scale feature extraction network is used to extract features from the image to be detected at multiple scales to obtain feature maps at multiple different scales. The image to be detected includes power distribution lines. Multiple feature maps are fused across scales using a feature fusion network and a focus modulation module to obtain multiple feature modulation maps of different scales. The feature modulation maps at the smallest scale are segmented by a segmentation network to obtain multiple mesh mask maps of different scales. The mesh mask images are fused with the feature modulation images of the corresponding scale to obtain multiple fused feature images. Foreign object detection is then performed on the multiple fused feature images through a detection network to obtain foreign object detection results.

2. The method according to claim 1, characterized in that, The step of performing wire mesh region segmentation on the smallest-scale feature modulation map among multiple feature modulation maps using a segmentation network to obtain multiple wire mesh mask maps of different scales includes: The segmentation network is used to perform wire mesh region segmentation on the smallest scale feature modulation map among multiple feature modulation maps to obtain a probability map. The probability maps are upsampled to the scale corresponding to each feature modulation map to obtain multiple upsampled probability maps. The upsampled probability maps are normalized to obtain multiple mesh mask maps.

3. The method according to claim 2, characterized in that, The process of fusing each of the wire mesh mask maps with the feature modulation maps of the corresponding scale to obtain multiple fused feature maps includes: Each of the aforementioned net mask images is multiplied element-wise with the corresponding scale of the feature modulation image to obtain multiple fused feature images.

4. The method according to claim 1, characterized in that, The feature fusion network includes multiple feature fusion layers, and the number of focus modulation modules is multiple, with each feature fusion layer corresponding to one of the multiple focus modulation modules; The process of performing cross-scale feature fusion on multiple feature maps through a feature fusion network and a focus modulation module to obtain multiple feature modulation maps of different scales includes: Multiple feature maps are input into the corresponding feature fusion layer, and the output of the feature fusion layer is modulated by the corresponding focus modulation module to obtain multiple feature modulation maps of different scales.

5. The method according to any one of claims 1-4, characterized in that, The multi-scale feature extraction network, the feature fusion network, the focus modulation module, the segmentation network, and the detection network constitute a foreign object detection model for power distribution lines; the training method for the foreign object detection model for power distribution lines includes: Input the sample image into the model to be trained to obtain the sample mesh mask and the sample foreign object detection results; Based on the foreign object detection results of the sample and the foreign object detection label of the sample image, the detection task loss is obtained; Based on the sample mesh mask image and the mesh mask label of the sample image, the segmentation task loss is obtained; The model to be trained is trained based on the detection task loss and the segmentation task loss, and the foreign object detection model of the power distribution line is obtained after the training is completed.

6. The method according to claim 5, characterized in that, The sample foreign object detection result includes a foreign object category and a foreign object bounding box, and the foreign object detection label includes a foreign object category label and a foreign object bounding box label; the detection task loss is obtained based on the sample foreign object detection result and the foreign object detection label of the sample image, including: Based on the foreign object category and the foreign object category label, the classification loss is obtained; Based on the foreign object bounding box and the foreign object bounding box label, the bounding box regression loss is obtained; The detection task loss is obtained based on the classification loss and the bounding box regression loss.

7. A foreign object detection device for power distribution lines, characterized in that, The device includes: The feature extraction module is used to perform multi-scale feature extraction on the image to be detected through a multi-scale feature extraction network to obtain multiple feature maps of different scales, wherein the image to be detected includes power distribution lines; The feature fusion module is used to perform cross-scale feature fusion on multiple feature maps through a feature fusion network and a focus modulation module to obtain multiple feature modulation maps of different scales. The segmentation module is used to perform wire mesh region segmentation on the smallest scale of the feature modulation map in multiple feature modulation maps through a segmentation network to obtain multiple wire mesh mask maps of different scales. The foreign object detection module is used to fuse each of the wire mesh mask images with the feature modulation map of the corresponding scale to obtain multiple fused feature maps, and to perform foreign object detection processing on the multiple fused feature maps through a detection network to obtain foreign object detection results.

8. A computer 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.