Power line image segmentation method and apparatus

By using a grid-based polar coordinate representation and feature enhancement network architecture, combined with an undirected cosine angle difference loss function and line integral method, the problem of insufficient global continuity in power line detection is solved, achieving high-precision and robust power line detection.

CN122415657APending Publication Date: 2026-07-17CHINA THREE GORGES UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA THREE GORGES UNIV
Filing Date
2026-05-26
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Existing deep learning methods lack the ability to describe global continuity in power line detection, resulting in broken, misaligned, or discontinuous detection results, which cannot meet the high-efficiency and high-precision requirements of UAV inspection.

Method used

A grid-based polar coordinate representation method is used to encode and reconstruct power line images. By combining a feature enhancement network architecture and an undirected cosine angle difference loss function, and through deep neural network training and line integral methods, global continuity reconstruction of power lines is achieved.

Benefits of technology

It improves the accuracy and robustness of power line detection, avoids boundary ambiguity and line segment breakage, and can maintain the topological continuity of power lines in complex backgrounds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122415657A_ABST
    Figure CN122415657A_ABST
Patent Text Reader

Abstract

This invention provides a method and apparatus for power line image segmentation. The method includes: dividing a power line image sample into multiple grids; encoding power line segments within each grid using polar coordinates to obtain local polar coordinate labels; using the local polar coordinate labels and category labels as ground truth labels; using a deep neural network to obtain the classification confidence and local polar coordinate regression parameters of the power line segments as prediction results; matching the prediction results with the ground truth labels; training the network based on the overall loss function between the prediction results and their corresponding ground truth labels; using the trained deep neural network to obtain local polar coordinate regression parameters; reconstructing the global polar coordinates based on the local polar coordinate regression parameters to obtain line segments in the global coordinate system; and using the line integral method to obtain the final continuous global power line based on the line segments in the global coordinate system. This invention improves the continuity, robustness, and accuracy of power line image segmentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method and apparatus for segmenting power line images. Background Technology

[0002] The detection and perception of power transmission lines are essential for ensuring the safe operation and routine maintenance of the power grid, and are also key capabilities for enabling intelligent inspection and low-altitude autonomous obstacle avoidance by unmanned aerial vehicles (UAVs). Unlike conventional target detection or segmentation tasks, power lines have a very unique geometric shape in images: their spatial proportion is extremely small (usually less than 5% of the total image pixels), but their linear structure often runs through the entire field of view. Furthermore, due to the highly complex shooting environment of UAV inspection images, the weak visual signals of power lines are easily masked by background noise such as trees and building edges, leading to frequent breaks or fragmentation in the detection results. Therefore, achieving accurate perception and continuous extraction of power lines has always been one of the most challenging problems in the field of computer vision.

[0003] Early power line localization typically relied on traditional image processing algorithms. These methods generally followed a three-stage process: first, candidate edges were extracted using filters or edge detection operators; then, line segments were detected using Hough Transform or line tracing algorithms; and finally, prior constraints such as parallelism, length, or spatial layout were used to filter and optimize the candidate results. Traditional methods, because they do not require extensive training data, are effective against ideal, clean backgrounds such as the sky. However, when faced with complex field backgrounds in actual inspections, these methods are highly susceptible to texture interference, leading to high false positive and false negative rates, making them unsuitable for practical applications in complex scenarios.

[0004] In recent years, with the development of artificial intelligence, deep learning-based methods have become the mainstream solution for power line localization. Current deep learning methods mainly fall into two major technical routes: the first is line segmentation-based methods, which primarily utilize encoder-decoder architectures, dilated convolutions, or pyramid pooling network structures to extract features from images, directly outputting dense pixel-level power line masks. The second is line detection-based methods, which aim to directly output geometric parameter representations of line segments, such as by predicting the distance and orientation fields from pixels to line segments, or by using differentiable Hough transforms to map line segments to polar coordinate space for feature encoding. Although these deep learning methods have significantly improved robustness and local detection accuracy compared to traditional methods, they still have significant shortcomings in describing the overall continuous topological structure of power lines.

[0005] Specifically, while existing deep learning methods have greatly improved detection accuracy, they still face significant challenges in achieving global continuous localization. Pixel-level segmentation models based on Convolutional Neural Networks (CNNs) inherently suffer from limited effective receptive fields, and these models often rely excessively on local texture features, making them insufficient for macroscopic modeling of long, narrow geometric structures at long distances.

[0006] In summary, existing methods have poor ability to describe the global spatial continuity of power lines. In the final prediction results, slender power lines with large spans often appear broken, misaligned, or discontinuous. In real-world UAV inspection scenarios with complex tree backgrounds, existing mainstream segmentation-based deep learning models (such as SegFormer and MiT-Unet) exhibit severe breakage and fragmentation when extracting power lines, even accompanied by local false detections and misalignments. They are completely unable to maintain the original continuous and complete topological structure of power lines in the physical world, unlike ground truth (GT) labels. Such broken detection results fail to reflect the true shape of power lines and cannot be directly used for subsequent line sag analysis or fault location, making it difficult to meet the needs of efficient and high-precision inspection in practical engineering. Summary of the Invention

[0007] To address the problems existing in the prior art, the present invention provides a method and apparatus for power line image segmentation.

[0008] This invention provides a method for segmenting power line images, comprising:

[0009] The power line image samples are divided into multiple grids. Each power line segment in each grid is encoded using polar coordinate representation to obtain the local polar coordinate label of each power line segment in each grid. The local polar coordinate label and category label of each power line segment in each grid are used as the true label.

[0010] The classification confidence score and local polar coordinate regression parameters of each power line segment in each grid are obtained using a deep neural network as the prediction result;

[0011] The predicted result of each power line segment in each grid is matched with the real label to obtain the real label corresponding to each predicted result. The deep neural network is trained according to the overall loss function between each predicted result and its corresponding real label.

[0012] The local polar coordinate regression parameters of each electric field line segment in each grid of the electric field line image to be segmented are obtained by using the trained deep neural network. The global polar coordinates are reconstructed according to the local polar coordinate regression parameters of the electric field line image to be segmented to obtain the line segments in the global coordinate system.

[0013] The final continuous global power lines are obtained by using line integrals based on line segments in the global coordinate system.

[0014] The present invention also provides a power line image segmentation apparatus, comprising:

[0015] The encoding module is used to divide the power line image samples into multiple grids, encode each power line segment in each grid using polar coordinate representation, obtain the local polar coordinate label of each power line segment in each grid, and use the local polar coordinate label and category label of each power line segment in each grid as the true label.

[0016] The prediction module is used to obtain the classification confidence and local polar coordinate regression parameters of each power line segment in each grid using a deep neural network, as the prediction result;

[0017] The training module is used to match the prediction results of each power line segment in each grid with the real labels to obtain the real label corresponding to each prediction result, and to train the deep neural network according to the overall loss function between each prediction result and its corresponding real label.

[0018] The reconstruction module is used to obtain the local polar coordinate regression parameters of each electric line segment in each grid in the electric line image to be segmented using the trained deep neural network, and to perform global polar coordinate reconstruction based on the local polar coordinate regression parameters corresponding to the electric line image to be segmented, so as to obtain the line segment in the global coordinate system.

[0019] The generation module is used to obtain the final continuous global power lines based on line segments in the global coordinate system using the line integral method.

[0020] The power line image segmentation method and apparatus provided by this invention have the following advantages:

[0021] 1. This invention uses a grid-based polar coordinate representation method to encode and reconstruct local line segments, which can extract the geometric properties of electric field lines more accurately and avoid the boundary blurring and line segment breakage problems that are easily caused by traditional pixel-level segmentation.

[0022] 2. A dedicated feature enhancement network architecture was designed and combined with an undirected cosine angle difference loss function, which effectively expanded the receptive field and enhanced the features of fine lines, eliminated the ambiguity of the sign in angle prediction, and helped improve the stability of model training and the robustness of detection in complex backgrounds.

[0023] 3. A line integral method based on graph theory and spatial pipeline constraints is proposed, which can adaptively assemble discrete line segments into topologically continuous long lines. This method not only naturally adapts to various drooping shapes of power lines, but also solves the technical bottleneck of fragmented detection results in existing algorithms. Attached Figure Description

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

[0025] Figure 1 This is a flowchart illustrating the power line image segmentation method provided by the present invention;

[0026] Figure 2 This is a schematic diagram of the overall framework of the power line image segmentation method provided by the present invention;

[0027] Figure 3 This is a schematic diagram of the transformation from local polar coordinates to global polar coordinates in the power line image segmentation method provided by the present invention;

[0028] Figure 4 This is a schematic diagram of the line integration process in the power line image segmentation method provided by the present invention;

[0029] Figure 5 This is a schematic diagram comparing the prediction results of the power line image segmentation method provided by the present invention with those of existing methods;

[0030] Figure 6 This is a schematic diagram of the structure of the power line image segmentation device provided by the present invention. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0032] The following is combined with Figure 1 A method for segmenting power line images according to the present invention includes:

[0033] Step 101: Divide the power line image samples into multiple grids, encode each power line segment in each grid using polar coordinate representation, obtain the local polar coordinate label of each power line segment in each grid, and use the local polar coordinate label and category label of each power line segment in each grid as the true label.

[0034] Step 102: Use a deep neural network to obtain the classification confidence and local polar coordinate regression parameters of each power line segment in each grid as the prediction result;

[0035] Step 103: Match the prediction result of each power line segment in each grid with the real label to obtain the real label corresponding to each prediction result, and train the deep neural network according to the overall loss function between each prediction result and its corresponding real label.

[0036] Step 104: Use the trained deep neural network to obtain the local polar coordinate regression parameters of each electric field line segment in each grid of the electric field line image to be segmented, and perform global polar coordinate reconstruction based on the local polar coordinate regression parameters corresponding to the electric field line image to be segmented to obtain the line segment in the global coordinate system.

[0037] Step 105: Based on the line segments in the global coordinate system, use the line integral method to obtain the final continuous global power lines.

[0038] like Figure 2 As shown, the power line image segmentation method in this embodiment specifically includes the following steps:

[0039] Step 1: Local polar coordinate modeling. The input UAV inspection image is divided into a regular grid, and the local line segments within each grid are encoded using a grid-based polar coordinate representation method.

[0040] Step 2: Feature Extraction and Parameter Prediction. A feature enhancement network architecture is constructed to extract image features, and the classification confidence and local polar coordinate regression parameters of candidate power line segments within each grid are output through a prediction head network.

[0041] Step 3: Model Matching and Training. The Hungarian matching algorithm is used to establish a one-to-one correspondence between the predicted results and the true labels, and the network is jointly optimized end-to-end using a joint loss function (including undirected cosine angle difference).

[0042] Step 4: Global Polar Coordinate Reconstruction. During the inference phase, the local polar coordinate parameters predicted by the network are inversely geometrically mapped to restore the line segments and their endpoint coordinates in the global coordinate system.

[0043] Step 5: Line Integration. A line integration method is proposed and used to abstract global line segments into graph nodes, extract connected components, and perform smooth fitting under spatial pipeline constraints to generate the final continuous global power lines.

[0044] This embodiment proposes a grid-based polar coordinate modeling framework, abandoning the traditional pixel-level segmentation mode. By encoding local line segments into compact and accurate polar coordinate representations, it can more accurately and efficiently describe the geometric properties of power lines. It also provides a continuous power line extraction method based on local polar coordinate modeling and global line integration to solve the defects of existing deep learning methods in complex backgrounds, such as easy breakage, fragmentation, and lack of topological continuity in detection results. This aims to significantly improve the accuracy, continuity, and robustness of power line detection in UAV inspection images.

[0045] Based on the above embodiments, this embodiment encodes each power line segment within each grid using polar coordinates, obtaining a local polar coordinate label for each power line segment within each grid, including:

[0046] Skeletonization processing is performed on the binarized electric field mask in each grid to obtain a trajectory with a single pixel width, and the intersection points of the trajectory with each grid are extracted as local line segment endpoints;

[0047] Polar coordinate encoding is performed on the electric field line segments within each grid relative to the center vector of each grid to obtain the local polar coordinate label of each electric field line segment within each grid.

[0048] Power line image samples Divided into Each grid cell is used for local geometric modeling: the binarized electric field mask is skeletonized to obtain a trajectory ℓ with a single pixel width. For each grid cell intersecting the trajectory ℓ, the endpoints of the intersecting local line segments are extracted and set as follows: , ,like Figure 3 As shown in the left figure. For each line segment , relative to the grid center vector c=( , Perform polar coordinate encoding to obtain local polar coordinate labels. , , ].

[0049] Based on the above embodiments, the local polar coordinate labels for each power line segment within each grid in this embodiment include , and ;

[0050] in, This is the normalized result of the distance from the center of each grid to the normal distance of the electric field line segment within each grid. Let be the angle between the normal vector of the electric field line segment within each grid and the horizontal line.

[0051] line segment The unit normal vector n is defined as:

[0052] (1)

[0053] in, express The angle between the x-axis and the x-axis.

[0054] The normal distance d from the grid center to the line segment is defined as:

[0055] (2)

[0056] Let half the diagonal length of the grid cell be the maximum distance. Where w is the width of the grid and h is the height of the grid, the normalized distance is calculated as follows:

[0057] (3)

[0058] Since a line is undirected, the flip invariance rule is introduced: if the calculated distance satisfies... Then, invert both the distance and the normal vector: d = -d. = This operation ensures Furthermore, it maintains consistency between the direction encoding and the distance sign, thus avoiding numerical instability caused by sign ambiguity.

[0059] Based on the above embodiments, the deep neural network in this embodiment includes a backbone network, a feature enhancement module, and a prediction head module connected in sequence;

[0060] The backbone network includes multiple stages connected in sequence. Each of the multiple stages, except for the last stage, includes a downsampling layer and multiple ConvNeXt modules connected in sequence. The last stage includes a convolutional layer and multiple ConvNeXt modules connected in sequence.

[0061] The feature enhancement module includes a wavelet global attention module and a U-shaped denoising module connected in sequence;

[0062] The prediction head module includes two independent convolutional branches: one is a classification branch, which outputs classification confidence; the other is a regression branch, which outputs local polar coordinate regression parameters.

[0063] like Figure 2 As shown in the feature extraction and parameter prediction part of the network architecture, a deep neural network dedicated to power line feature extraction is constructed. This network specifically includes a backbone network, a feature enhancement module, and a prediction head module.

[0064] First, the backbone network employs an improved ConvNeXt architecture (called ConvNeXt-E). The input image, with dimensions 3×512×512, undergoes four stages of progressive downsampling. Each stage contains a downsampling layer and multiple ConvNeXt modules. The ConvNeXt modules integrate large-kernel deep convolutions, layer normalization, multilayer perceptron modules, and residual connections. This structure effectively expands the network's receptive field, crucial for modeling slender electric field structures. After these four stages, a feature map with dimensions 768×16×16 is output. To further extract global structural features of the electric field, a fifth stage (ConvNeXt-5th) is introduced into the backbone network. This stage first reduces the dimensionality of the 768-channel feature map to 384×16×16 using a 1×1 convolutional layer, and then adds multiple ConvNeXt modules at this fixed resolution for deeper feature extraction.

[0065] Subsequently, the feature map enters the Feature Enhancement module. This module cascades two core components: the Wavelet Global Attention (WGA) module and the U-Shaped Denoising (UND) module. The WGA module performs wavelet decomposition to separate low-frequency contours from high-frequency details in the feature map, aiming to enhance the feature enhancement of local subtle electric field lines; the UND module is a lightweight U-shaped structure that effectively suppresses complex background noise.

[0066] Finally, the feature map after feature enhancement is input into the prediction head. The prediction head consists of two independent 1×1 convolutional branches: one is a classification branch, which outputs a classification probability of size 16×16×2N; the other is a regression branch, which predicts the local polar coordinate parameters of the candidate electric field segments in the corresponding grid, with a size of 16×16×3N.

[0067] This embodiment designs a dedicated feature enhancement network architecture, which uses an improved ConvNeXt-E backbone network to extract long-range structural features and combines a feature enhancement module to enhance local fine line features and suppress background noise.

[0068] Based on the above embodiments, this embodiment matches the predicted result of each power line segment within each grid with the real label to obtain the real label corresponding to each predicted result, including:

[0069] Based on the classification confidence score in the prediction results, determine the probability that the predicted category is the category label in the true label;

[0070] Determine the distance between the predicted result and the normalized result of the distance from the center of each grid to the normal distance of the electric line segment in each grid in the true label;

[0071] Determine the undirected cosine angle difference loss between the predicted result and the normal vector of the electric line segment in each grid in the true label;

[0072] Based on the probability, distance, and undirected cosine angle difference loss, construct the matching cost matrix;

[0073] Based on the matching cost matrix, the true label of the optimal match of the prediction result is obtained by solving the linear assignment problem.

[0074] To achieve one-to-one supervision between the predicted results and the true labels, the Hungarian matching algorithm is used to establish the assignment relationship. For each grid cell, the model outputs a set of N candidate line segments. Let the predicted result and the true label set for grid cell (i,j) be as follows:

[0075] (4)

[0076] (5)

[0077] in, ∈{0,1} represents the background or foreground. To predict the probability of a positive sample, construct the matching cost matrix C∈ ,in Defined as prediction result With real labels The matching cost between them.

[0078]

[0079] (6)

[0080] in, This represents the prediction result for the k-th power line segment within the grid cell in the i-th row and j-th column. The actual label of the m-th power line segment in the i-th row and j-th column of the grid. The matching cost between them The formula for calculating the matching cost. This indicates the category label for the predicted category of the m-th power line segment. The probability, For the prediction results The normal vector of the k-th electric field segment With real labels The normal vector of the m-th electric field segment Cosine angle difference loss between them For the prediction results The normalized result of the normal distance from the center of the grid to the k-th power line segment. For real labels The normalized result of the normal distance from the center of the grid to the m-th power line segment.

[0081] After constructing the cost matrix C, the optimal matching is obtained by solving a linear assignment problem. Specifically, this involves finding the optimal permutation matrix. Minimize the inner product of the permutation matrix and the cost matrix:

[0082] (7)

[0083] The optimal permutation matrix A unique one-to-one allocation relationship is defined. ,satisfy At this point, each real label element in the grid has been precisely matched with its assigned prediction result.

[0084] This embodiment introduces an undirected cosine angle difference loss function to achieve the goal of stabilizing local line segment direction regression training.

[0085] Based on the above embodiments, this embodiment obtains a one-to-one correspondence. Then, the classification and regression branches are jointly trained. The formula for the overall loss function is: (8)

[0086] in, Let be the overall loss function. For the classification branch loss, the category label of the m-th power line segment is calculated. The probability of matching The losses between them were obtained. To regress the branch loss, the local polar coordinate label of the m-th power line segment is calculated. Matching local polar coordinate regression parameters The losses between them were obtained. The coefficients used to balance the classification branch loss and the regression branch loss, This is the normalized result of the normal distance from the grid center to the m-th power line segment. Let be the normal vector of the m-th power line segment. The normalized result of the normal distance from the grid center to the electric field line segment in the matched local polar coordinate regression parameters. The normal vector of the electric field line segment in the matched local polar coordinate regression parameters.

[0087] Specifically, classification branch loss Focal loss is employed to address the severe imbalance between foreground and background samples. Regression branch loss is also used. Calculated only for the matched foreground sample, it consists of three components:

[0088] (9)

[0089] Among them, the distance error term The use of Smooth L1 loss allows for smooth gradients near small errors while improving robustness to the difference; the angle regression term employs the same undirected cosine angle difference loss as in the matching cost. This calculation method satisfies the undirected geometric characteristics of electric field lines, effectively eliminating symbolic ambiguity and stabilizing the gradient of direction regression; furthermore, it introduces a unit norm constraint. To ensure numerical stability, each predicted direction vector is made to approximate the unit circle, defined as follows:

[0090] (10)

[0091] Based on the above embodiments, this embodiment performs global polar coordinate reconstruction according to the local polar coordinate regression parameters corresponding to the power line image to be segmented, to obtain line segments in the global coordinate system, including:

[0092] Based on the normalized result of the normal distance from the grid center to the power line segment in the local polar coordinate regression parameters corresponding to the power line image to be segmented, the local normal distance from the grid center to the power line segment is obtained.

[0093] The global normal distance from the grid center to the power line segment is obtained based on the local normal distance from the grid center to the power line segment and the projection distance of the grid center point vector onto the normal vector.

[0094] Based on the global normal distance, the straight line is reconstructed using polar coordinate equations in the global coordinate system;

[0095] Based on the intersections of the reconstructed lines with each grid, the global endpoint coordinates of each line segment within each grid are obtained.

[0096] During the model inference phase, the network outputs N local polar coordinate predictions for each grid cell. To obtain global power line results at the entire image level, these local predictions are transformed through polar coordinate reconstruction. This reconstruction process is an inverse geometric mapping that transforms local parameters back to the global image coordinate system, such as... Figure 3 As shown in the right figure.

[0097] Specifically, for each line segment predicted within a grid cell, the local normal distance is first recovered using the predicted normalized distance: The unit normal vector of this line segment remains unchanged in both the local and global coordinate systems. Let... This represents the normal distance of the line segment in the global coordinate system (e.g., Figure 3 (As shown by the blue line segment in the middle right figure), the global normal distance satisfies = d + .in, The projection distance of the grid center point vector onto the normal vector is calculated using the following formula:

[0098] (11)

[0099] In the formula, c is the center coordinate of the current grid, o is the origin of the global coordinate system, and n is the predicted unit normal vector.

[0100] Therefore, in the global image coordinate system, the reconstructed straight line can be fully described by the following polar coordinate equation:

[0101] (12)

[0102] To obtain the effective visible range of the reconstructed line within the current grid, the intersection points of the aforementioned global line equation with the four boundaries of the current grid are further calculated, thereby generating the global endpoint coordinates of the decoded line segment. This completes the full mapping process from local polar coordinate encoding to global coordinate system decoding.

[0103] Based on the above embodiments, this embodiment obtains the final continuous global power lines using the line integral method based on line segments in the global coordinate system, including:

[0104] Each line segment in the global coordinate system is treated as a node, and geometric constraints are used to establish connections between nodes as edges between nodes, thus constructing an undirected graph.

[0105] The undirected graph is divided into multiple independent connected components based on its connectivity.

[0106] A local weighted scatter smoothing algorithm is used to reconstruct the continuous trajectory of each connected component, resulting in the final continuous global power line.

[0107] To recover a continuous power line topology from a discrete set of global line segment predictions, such as... Figure 4 As shown, first construct an undirected graph. .in, This represents the set of predicted global line segments in the entire image, with each predicted line segment treated as a node in the graph.

[0108] Geometric constraints are used to establish connecting edges between nodes. Specifically, the global set of line segments is traversed, and the geometric relationships between each pair of line segment nodes are calculated. For any two candidate line segments in the set... and If they simultaneously satisfy the following directional consistency constraint and endpoint proximity constraint, then an edge is established between them. .

[0109] The formula for the directional consistency constraint is as follows:

[0110] (13)

[0111] The formula for the endpoint proximity constraint is:

[0112] (14)

[0113] In the formula, It is a line segment The direction angle, It is a line segment The direction angle, and Representing line segments respectively and line segments The coordinates of the two global endpoints; and These are the set maximum angle difference threshold and maximum Euclidean distance threshold, respectively. Furthermore, to prevent the erroneous merging of spatially separated parallel power lines, the perpendicular distance between collinear segments is further limited, requiring them to be within a certain perpendicular distance threshold. Within the range.

[0114] Completed drawing After construction, the graph is divided into multiple independent connected components based on its connectivity. Finally, for each valid connected component, a local weighted scatter smoothing algorithm is applied to reconstruct the continuous trajectory. For example... Figure 2 As shown in the bottom right corner, the reconstruction process specifically includes:

[0115] 1. PCA (Principal Component Analysis) Alignment: Aligns all line segment nodes within a connected component to the principal axis extracted through principal component analysis.

[0116] 2. Spatial Pipe Constraint and LOESS Fitting: A spatial pipe constraint based on a predefined pipe width is applied along the principal axis. Subsequently, a local window slides along the principal axis, performing weighted regression to smoothly fit the local curve; during this process, a boundary clipping mechanism is triggered to forcibly pull any anomalous noise attempting to deviate from the space back within the pipe boundary.

[0117] The above line integration process naturally adapts to various physical forms of power lines, whether they are straight or naturally drooping, robustly filters out local noise, and ultimately outputs a smooth, continuous, and topologically complete global power line prediction result.

[0118] This embodiment proposes the use of a line integral module in the inference stage. By abstracting the locally predicted line segments into graph nodes and extracting connected components, and finally applying LOESS for smooth fitting, continuous and complete global power line reconstruction is achieved.

[0119] A comparative diagram of the prediction results of the method provided in this embodiment and existing methods is shown below. Figure 5 As shown, it can be seen that the method provided in this embodiment is significantly better than existing methods in terms of prediction results.

[0120] The electric line image segmentation apparatus provided by the present invention is described below. The electric line image segmentation apparatus described below can be referred to in correspondence with the electric line image segmentation method described above.

[0121] like Figure 6 As shown, the electric power line image segmentation device provided by the present invention includes an encoding module 601, a prediction module 602, a training module 603, a reconstruction module 604, and a generation module 605, wherein:

[0122] The encoding module 601 is used to divide the power line image sample into multiple grids, encode each power line segment in each grid using the polar coordinate representation method, obtain the local polar coordinate label of each power line segment in each grid, and use the local polar coordinate label and category label of each power line segment in each grid as the real label.

[0123] The prediction module 602 is used to obtain the classification confidence and local polar coordinate regression parameters of each power line segment in each grid using a deep neural network, as the prediction result;

[0124] The training module 603 is used to match the prediction result of each power line segment in each grid with the real label to obtain the real label corresponding to each prediction result, and to train the deep neural network according to the overall loss function between each prediction result and its corresponding real label.

[0125] The reconstruction module 604 is used to obtain the local polar coordinate regression parameters of each electric line segment in each grid in the electric line image to be segmented using the trained deep neural network, and to perform global polar coordinate reconstruction based on the local polar coordinate regression parameters corresponding to the electric line image to be segmented, so as to obtain the line segment in the global coordinate system.

[0126] The generation module 605 is used to obtain the final continuous global power lines based on the line segments in the global coordinate system using the line integral method.

[0127] The main inventive points of this invention include:

[0128] 1. A grid-based polar coordinate representation method is proposed, which abandons the traditional pixel-level segmentation approach and transforms the complex task of extracting electric power lines into direct encoding and regression prediction of the geometric properties of line segments within a local grid.

[0129] 2. A dedicated feature enhancement network architecture was designed, using an improved ConvNeXt-E as the backbone network to expand the effective receptive field, and enhancing local fine electric field features and suppressing complex background noise through WGA and UND modules.

[0130] 3. By introducing an undirected cosine angle difference loss function, the forward and reverse ambiguity in the prediction of power line direction is eliminated, effectively stabilizing the regression training process of local line segment direction.

[0131] 4. A line integral method based on graph theory and spatial pipeline constraints is proposed. By abstracting locally predicted discrete line segments into graph nodes, adjacency relationships are established using geometric constraints and connected components are extracted. Based on this, smooth fitting is performed to achieve topology reconstruction from local discrete line segments to global continuous power lines.

[0132] The key technology of this solution lies in the deep integration of "local mesh polar coordinate modeling" and "global line-level topology reconstruction", which overcomes the technical bottleneck of traditional segmentation-based power line detection methods, which are prone to breakage and cannot maintain structural continuity under complex backgrounds and weak textures.

[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for segmenting power line images, characterized in that, include: The power line image samples are divided into multiple grids. Each power line segment in each grid is encoded using polar coordinate representation to obtain the local polar coordinate label of each power line segment in each grid. The local polar coordinate label and category label of each power line segment in each grid are used as the true label. The classification confidence score and local polar coordinate regression parameters of each power line segment in each grid are obtained using a deep neural network as the prediction result; The predicted result of each power line segment in each grid is matched with the real label to obtain the real label corresponding to each predicted result. The deep neural network is trained according to the overall loss function between each predicted result and its corresponding real label. The local polar coordinate regression parameters of each electric field line segment in each grid of the electric field line image to be segmented are obtained by using the trained deep neural network. The global polar coordinates are reconstructed according to the local polar coordinate regression parameters of the electric field line image to be segmented to obtain the line segments in the global coordinate system. The final continuous global power lines are obtained by using line integrals based on line segments in the global coordinate system.

2. The power line image segmentation method according to claim 1, characterized in that, Each power line segment within each grid is encoded using polar coordinates, resulting in a local polar coordinate label for each power line segment within each grid, including: Skeletonization processing is performed on the binarized electric field mask in each grid to obtain a trajectory with a single pixel width, and the intersection points of the trajectory with each grid are extracted as local line segment endpoints; Polar coordinate encoding is performed on the electric field line segments within each grid relative to the center vector of each grid to obtain the local polar coordinate label of each electric field line segment within each grid.

3. The power line image segmentation method according to claim 2, characterized in that, The local polar coordinate labels for each power line segment within each grid include , and ; in, This is the normalized result of the distance from the center of each grid to the normal distance of the electric field line segment within each grid. Let be the angle between the normal vector of the electric field line segment within each grid and the horizontal line.

4. The power line image segmentation method according to claim 1, characterized in that, The deep neural network includes a backbone network, a feature enhancement module, and a prediction head module connected in sequence. The backbone network includes multiple stages connected in sequence. Each of the multiple stages, except for the last stage, includes a downsampling layer and multiple ConvNeXt modules connected in sequence. The last stage includes a convolutional layer and multiple ConvNeXt modules connected in sequence. The feature enhancement module includes a wavelet global attention module and a U-shaped denoising module connected in sequence; The prediction head module includes two independent convolutional branches: one is a classification branch, which outputs classification confidence; the other is a regression branch, which outputs local polar coordinate regression parameters.

5. The power line image segmentation method according to claim 3, characterized in that, The predicted result for each power line segment within each grid is matched with the ground truth label to obtain the ground truth label corresponding to each predicted result, including: Based on the classification confidence score in the prediction results, determine the probability that the predicted category is the category label in the true label; Determine the distance between the predicted result and the normalized result of the distance from the center of each grid to the normal distance of the electric line segment in each grid in the true label; Determine the undirected cosine angle difference loss between the predicted result and the normal vector of the electric line segment in each grid in the true label; Based on the probability, distance, and undirected cosine angle difference loss, construct the matching cost matrix; Based on the matching cost matrix, the true label of the optimal match of the prediction result is obtained by solving the linear assignment problem.

6. The power line image segmentation method according to claim 5, characterized in that, The matching cost matrix is ​​constructed using the following formula based on the probability, distance, and undirected cosine angle difference loss: ; in, This represents the prediction result for the k-th power line segment within the grid cell in the i-th row and j-th column. The actual label of the m-th power line segment in the i-th row and j-th column of the grid. The matching cost between them The formula for calculating the matching cost. This indicates the category label for the predicted category of the m-th power line segment. The probability, For the prediction results The normal vector of the k-th electric field segment With real labels The normal vector of the m-th electric field segment Cosine angle difference loss between them For the prediction results The normalized result of the normal distance from the center of the grid to the k-th power line segment. For real labels The normalized result of the normal distance from the center of the grid to the m-th power line segment.

7. The power line image segmentation method according to claim 5, characterized in that, The formula for the overall loss function is: ; in, Let be the overall loss function. For the classification branch loss, the category label of the m-th power line segment is calculated. The probability of matching The losses between them were obtained. To calculate the regression branch loss, the local polar coordinate label of the m-th power line segment is calculated. Matching local polar coordinate regression parameters The losses between them were obtained. The coefficients used to balance the classification branch loss and the regression branch loss, This is the normalized result of the normal distance from the grid center to the m-th power line segment. Let be the normal vector of the m-th power line segment. The normalized result of the normal distance from the grid center to the electric field line segment in the matched local polar coordinate regression parameters. The normal vector of the electric field line segment in the matched local polar coordinate regression parameters.

8. The power line image segmentation method according to claim 3, characterized in that, Based on the local polar coordinate regression parameters corresponding to the power line image to be segmented, global polar coordinate reconstruction is performed to obtain line segments in the global coordinate system, including: Based on the normalized result of the normal distance from the grid center to the power line segment in the local polar coordinate regression parameters corresponding to the power line image to be segmented, the local normal distance from the grid center to the power line segment is obtained. The global normal distance from the grid center to the power line segment is obtained based on the local normal distance from the grid center to the power line segment and the projection distance of the grid center point vector onto the normal vector. Based on the global normal distance, the straight line is reconstructed using polar coordinate equations in the global coordinate system; Based on the intersections of the reconstructed lines with each grid, the global endpoint coordinates of each line segment within each grid are obtained.

9. The power line image segmentation method according to claim 1, characterized in that, Based on line segments in the global coordinate system, the final continuous global electric field lines are obtained using the line integral method, including: Each line segment in the global coordinate system is treated as a node, and geometric constraints are used to establish connections between nodes as edges between nodes to construct an undirected graph. The undirected graph is divided into multiple independent connected components based on its connectivity. A local weighted scatter smoothing algorithm is used to reconstruct the continuous trajectory of each connected component, resulting in the final continuous global power line.

10. A power line image segmentation device, characterized in that, include: The encoding module is used to divide the power line image samples into multiple grids, encode each power line segment in each grid using polar coordinate representation, obtain the local polar coordinate label of each power line segment in each grid, and use the local polar coordinate label and category label of each power line segment in each grid as the true label. The prediction module is used to obtain the classification confidence and local polar coordinate regression parameters of each power line segment in each grid using a deep neural network, as the prediction result; The training module is used to match the prediction results of each power line segment in each grid with the real labels to obtain the real label corresponding to each prediction result, and to train the deep neural network according to the overall loss function between each prediction result and its corresponding real label. The reconstruction module is used to obtain the local polar coordinate regression parameters of each electric line segment in each grid in the electric line image to be segmented using the trained deep neural network, and to perform global polar coordinate reconstruction based on the local polar coordinate regression parameters corresponding to the electric line image to be segmented, so as to obtain the line segment in the global coordinate system. The generation module is used to obtain the final continuous global power lines based on line segments in the global coordinate system using the line integral method.