A method for identifying UAV power distribution network equipment based on neighbor-to-neighbor density peak clustering

By using a clustering method based on the density peaks of mutual neighbors, dynamically adjusting the RGB channel weights and weighted filtering, and combining morphological reconstruction and superpixel segmentation, the problem of low equipment recognition accuracy in UAV inspection is solved, and efficient recognition and classification in complex environments is achieved.

CN121010786BActive Publication Date: 2026-03-06INFORMATION & COMMNUNICATION BRANCH STATE GRID JIANGXI ELECTRIC POWER CO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511544549.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2026-03-06
Estimated Expiration
2045-10-28

AI Technical Summary

Technical Problem

Existing drone inspection technology struggles to accurately identify power distribution network equipment in complex environments. Image quality degradation leads to the loss of equipment details, traditional grayscale methods cannot adapt to complex lighting conditions, and clustering algorithms are not adaptable to differences in equipment size, resulting in low recognition accuracy.

Method used

A clustering method based on the density peaks of mutual nearest neighbors is adopted. The weights of RGB channels are dynamically allocated by measuring the gray-scale structure similarity. The total energy function is constructed by combining saturation features. Weighted guided filtering and morphological reconstruction are used, combined with superpixel segmentation and two-dimensional wavelet decomposition, to optimize the sample allocation strategy and improve the recognition accuracy of the device.

Benefits of technology

It effectively preserves equipment details in complex lighting environments, improves image quality and processing efficiency, enhances the classification adaptability of multi-scale equipment, and strengthens the automation level and safety and reliability of power distribution network operation and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121010786B_ABST
    Figure CN121010786B_ABST
Patent Text Reader

Abstract

This invention discloses a method for identifying UAV-based power distribution network equipment based on neighboring density peak clustering, belonging to the field of power distribution network equipment inspection technology. The method includes: acquiring the original RGB image of the power distribution line; outputting the contrast feature coefficients of each channel; constructing a saturation retention term; calculating the contrast feature retention term, constructing the total energy function, using a discrete search strategy to solve for the optimal channel weights, and outputting the initial grayscale image; sequentially performing weighted guided filtering, morphological reconstruction, and superpixel segmentation operations; performing two-dimensional wavelet decomposition on the superpixel segmented image to extract feature vectors; calculating local density and relative distance, selecting cluster centers, and completing sample allocation based on shared neighboring similarity to achieve power distribution network equipment identification. This invention effectively solves problems such as detail loss, noise interference, edge breakage, and multi-scale equipment classification confusion under complex lighting conditions, effectively improving the identification accuracy and efficiency of UAV inspection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power distribution network equipment inspection technology, specifically a method for identifying power distribution network equipment using unmanned aerial vehicles (UAVs) based on clustering of density peaks of neighboring devices. Background Technology

[0002] With the advancement of intelligent power distribution network construction, drone inspection technology, with its advantages of high efficiency and flexibility, has become a core means of monitoring power distribution network equipment. The specific composition of existing drone inspection systems is as follows: Figure 1 As shown, the system includes a ground station and an airborne UAV component. In existing technologies, power distribution network equipment such as poles, transformers, insulators, clamps, and surge arresters are dispersed and vary significantly in size. Their key details are crucial for UAV inspection and identification, and image recognition accuracy directly impacts inspection efficiency and fault diagnosis accuracy. However, the complex outdoor inspection environment of power distribution network equipment often leads to image quality degradation due to multiple factors: aberrations and diffraction in the UAV's optical system cause imaging deviations and image distortion, affecting the presentation of equipment details; unstable solar radiation, cloud cover, and atmospheric turbulence in the natural environment easily cause image blurring and uneven brightness; unstable imaging device attitude can cause geometric distortions such as equipment shape and position deformation; relative motion between the imaging system and the equipment can blur the equipment outline; Gaussian noise and impulse noise are easily introduced throughout the image processing, destroying original features; and the presence of numerous objects in the background with colors and textures similar to the equipment makes it easy to confuse the equipment with the background. These problems make it difficult for traditional image recognition methods to accurately extract equipment features, limiting the application effectiveness of automated UAV inspection.

[0003] In the field of power distribution network equipment identification, accurate identification can improve the accuracy of subsequent target classification and defect detection, reduce model false alarms, and reduce unnecessary computing power consumption, which is of great significance for improving the efficiency of intelligent inspection of power distribution networks and ensuring the safe operation of the power grid. However, existing technologies have shortcomings: grayscale uses fixed RGB channel weights, which cannot adapt to complex lighting conditions and is prone to losing the subtle structural information of power distribution network equipment; the preprocessing process is difficult to balance noise removal and edge preservation, incomplete noise removal will affect feature extraction, and excessive smoothing will lead to edge breakage; clustering algorithms are not adaptable to differences in equipment size, and traditional density peak clustering is prone to the problem of large equipment being overly affected and small equipment being ignored in local density calculation, resulting in chaotic classification of multi-scale equipment.

[0004] Based on this, we now provide a method for identifying UAV power distribution network equipment based on clustering of mutual nearest neighbor density peaks, which can eliminate the drawbacks of existing technical solutions. Summary of the Invention

[0005] The purpose of this invention is to provide a method for identifying UAV power distribution network equipment based on clustering of density peaks of mutual nearest neighbors, so as to solve the problem of the shortcomings of existing power distribution network equipment identification in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] The method for identifying UAV power distribution network equipment based on mutual nearest neighbor density peak clustering specifically includes the following steps:

[0008] Step S1: Obtain the original RGB image of the power distribution line using a drone;

[0009] Step S2: Based on grayscale structural similarity measurement, quantify the structural similarity between the R, G, and B channels and the original RGB image, and output the contrast feature coefficients of each channel by normalizing the sum of the three channel scores.

[0010] Step S3: Define the single-channel saturation feature as the absolute difference between the corresponding channel pixel and the mean of the three channels, construct a saturation retention term based on the L2 norm, and constrain the matching relationship between grayscale difference and saturation difference;

[0011] Step S4: Calculate the contrast feature preservation term by combining the contrast feature coefficients, introduce the saturation preservation term, construct the total energy function, and use a discrete search strategy to solve for the channel weight coefficients that satisfy the minimization of the total energy function, and output the initial grayscale image.

[0012] Step S5: Using the original RGB image as the guide image, calculate the 3×3 neighborhood variance of the pixels, dynamically adjust the filtering weights based on the variance, construct a least squares loss function with regularization parameters to optimize the parameters, remove noise and retain the device edge contours, and output the weighted guided filtering grayscale image.

[0013] Step S6: Perform an erosion operation on the enhanced grayscale image using a 3×3 rectangular structuring element to eliminate noise, and then perform a dilation operation to expand the device boundary and repair the broken edges of the device. After that, use structuring elements of increasing size of 3×3, 5×5, and 7×7 in sequence to iteratively perform open reconstruction and closed reconstruction operations, and output a morphologically reconstructed enhanced grayscale image.

[0014] Step S7: Convert the morphologically reconstructed and enhanced grayscale image to Lab space, calculate the Sobel gradient map, select the gradient minimum region as the seed node, set the color threshold and texture threshold, divide the superpixel blocks according to feature similarity, iteratively optimize the boundary pixel assignment, and output the superpixel segmentation image.

[0015] Step S8: Perform two-dimensional wavelet decomposition on the superpixel segmented image to generate smooth sub-images and detail sub-images. Calculate the mean and variance of the wavelet decomposition coefficients of each sub-image and construct the feature vector and feature dataset.

[0016] Step S9: Determine the number of nearest neighbors for each sample using Euclidean distance, and obtain the mutual nearest neighbor set composed of mutually nearest neighbor samples, and the shared mutual nearest neighbor set composed of the intersection of the mutual nearest neighbors of any two samples.

[0017] Step S10: Calculate the local density and relative distance of all samples, normalize the two and multiply them, and select the samples with the largest product as cluster centers.

[0018] Step S11: Divide the neighboring samples of each cluster center into the corresponding clusters, and then allocate the remaining samples according to the shared neighboring similarity to obtain the identification results of the power distribution network equipment.

[0019] Preferably, the formula for calculating the contrast feature coefficient in step S2 includes:

[0020] ;

[0021] ;

[0022] ;

[0023] in, , , These are the contrast characteristic coefficients for the R, G, and B channels. , , , This is a sub-graph corresponding to the single channels of R, G, and B. , , These correspond to the average gray-level structural similarity scores of single-channel R, G, and B images, respectively. The gray-level structural similarity measure includes brightness similarity, contrast similarity, and structural similarity. The sum of the scores for the R, G, and B channels.

[0024] Preferably, in step S3, the formula for calculating the single-channel saturation characteristic is:

[0025] ;

[0026] in, It is a single-channel saturation feature. For the corresponding channel pixels, ;

[0027] The formula for calculating the saturation retention term includes:

[0028] ;

[0029] ;

[0030] in, Saturation retention term This is the grayscale mapping function. , For channel pixels , The corresponding value in the grayscale image, , It is a set containing both local and non-local candidate pixel pairs. , For channel pixels , The absolute difference from the three-channel mean , , Let be the channel weight coefficients to be solved, satisfying the constraints. .

[0031] Preferably, in step S4, the formula for calculating the contrast feature retention term is:

[0032] ;

[0033] in, For contrast feature preservation terms based on Gaussian distribution, A constant greater than 0 These are the contrast characteristic coefficients corresponding to a single channel. , For the corresponding channel pixels , The possible values ​​of ;

[0034] The formula for calculating the total energy function is as follows: ;

[0035] in, Let be the total energy function. Adjustment parameters to balance different energy terms;

[0036] The discrete search strategy specifically includes: [the following is a list of strategies]. , , The value range is discretized into 10 intervals with a step size of 0.1. Each weight coefficient generates 11 candidate values. All candidate combinations that satisfy the weight coefficient and constraints are traversed, and the combination that minimizes the total energy function is selected as the optimal channel weight.

[0037] Preferably, in step S5, the expression for the filter weight function is:

[0038] ;

[0039] in, Here is the filter weight function. For pixels The variance within the surrounding 3×3 neighborhood reflects the texture complexity within the corresponding region. For pixels The variance within the surrounding 3×3 neighborhood, The total number of pixels in the guide map. To prevent constants with a denominator of zero, the value is taken as... ;

[0040] The formula for the least squares loss function is: ;

[0041] in, The least squares loss function is used. For the current filtering window, , These are the linear coefficients within the filtering window. To input grayscale image pixel values, For regularization parameters, These are the pixel values ​​for the guide image.

[0042] Preferably, the morphological reconstruction operation in step S6 includes erosion and dilation operations, and the expression for the erosion operation is: The expression for the expansion operation is: ,in, The image after erosion. The image after dilation. This is the grayscale image after weighted guided filtering. It is a 3×3 rectangular structuring element. , To calculate the minimum value of neighboring pixels, This is a calculation to obtain the maximum value of the neighboring pixels.

[0043] Preferably, the superpixel block division in step S7 is based on: calculating the difference between the color mean of each pixel and the seed node. Difference from texture variance ,when and If the pixel is similar to the seed node, it is merged into the same superpixel block. For color threshold, This is the texture threshold.

[0044] Preferably, in step S8, the two-dimensional wavelet decomposition operation is implemented through convolution, and the expression is: ,in, This represents the wavelet coefficients of the superpixel segmented image after undergoing a two-dimensional wavelet transform. It is a two-dimensional wavelet transform operator. To segment the grayscale distribution in an image using superpixels, It is a two-dimensional convolution operator. It is a two-dimensional mother wavelet function.

[0045] Preferably, in step S10, when the selected sample has the highest non-local density, the sum of the Euclidean distances from the corresponding sample to the sample with the highest local density and its nearest neighbors is calculated, and the minimum value of the mean distance is taken as the relative distance. Otherwise, the relative distance is the maximum value of the relative distances of other samples. Based on the relative distance, the local density of all samples is normalized and multiplied by the relative distance to obtain the decision value. The decision values ​​are arranged in descending order, and the first few samples with index values ​​are selected as cluster centers.

[0046] Preferably, the allocation process for the remaining samples specifically includes:

[0047] Assign the same category label to the nearest neighbor samples of each cluster center;

[0048] The remaining unclassified samples are assigned to the cluster of the assigned sample with the highest similarity, until all samples are assigned or there is no similarity between samples;

[0049] If the highest similarity between samples is 0, and there are still unassigned samples, then the corresponding sample category is marked as the one closest to it. The mode category of the assigned nearest neighbors, The number of nearest neighbors;

[0050] If multiple categories have the same highest score in the nearest neighbor voting, the DPC algorithm's allocation strategy is used to assign the sample to the cluster of the nearest sample with a higher local density.

[0051] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0052] This invention dynamically allocates RGB channel weights through grayscale structure similarity measurement, constructs a total energy function by combining saturation features, and uses a discrete search strategy to solve for the optimal weight combination. This approach can adapt to complex lighting environments and improves the ability to preserve fine structures such as surface cracks and clamp markings on insulators, avoiding the detail blurring problem caused by traditional fixed-weight grayscale methods. This method also integrates weighted guided filtering, morphological reconstruction, and superpixel segmentation, effectively suppressing Gaussian noise and impulse noise while completely preserving the edge contours of equipment, reducing the computational complexity of subsequent feature extraction, and improving image quality and processing efficiency. In addition, this invention incorporates a shared nearest neighbor design sample allocation strategy to improve the classification adaptability of multi-scale distribution network equipment such as towers, transformers, and insulators, improve recognition accuracy, and enhance the automation level and safety reliability of distribution network operation and maintenance. Attached Figure Description

[0053] Figure 1 This is a schematic diagram of the structure of an existing drone inspection system.

[0054] Figure 2 This is a flowchart illustrating the steps of the identification method of the present invention.

[0055] Figure 3 This is the overall flowchart of the present invention. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0057] like Figure 2 and Figure 3As shown, this paper presents a method for identifying UAV power distribution network equipment based on density peak clustering of neighboring devices. This method constructs an adaptive grayscale model for inspection images. Adaptation involves dynamically adjusting the weights of the RGB channels. Contrast feature coefficients are constructed based on grayscale structure similarity metrics, and a total energy function is designed in conjunction with saturation differences. Discrete search is used to optimize the channel weight parameters, allowing the weights to dynamically change with image lighting conditions and the color features of the equipment and background, thus adapting to complex outdoor environments. Grayscale conversion refers to the process of converting a three-dimensional RGB color image into a one-dimensional grayscale image. This adaptive grayscale model includes three core steps: feature coefficient calculation, saturation feature preservation, and energy function optimization. The contrast feature coefficients of each RGB channel are determined based on grayscale structure similarity metrics to preserve equipment contrast in complex lighting environments. Saturation feature preservation avoids the loss of high-saturation details in grayscale mapping by quantifying pixel saturation differences. Energy function optimization combines contrast and saturation constraints and uses discrete search to find the optimal weight combination, enhancing the classification adaptability to multi-scale power distribution network equipment and improving recognition accuracy. Density peak clustering (DPS) is used in this method. Clustering (DPC) is a density-based clustering algorithm based on the assumptions that "cluster center density is higher than surrounding samples" and "cluster centers are far apart". It selects cluster centers by calculating local density and relative distance, and then assigns samples to the clusters of their nearest neighbors with higher density. Mutual nearest neighbors refer to the bidirectional nearest neighbor relationship between samples used to optimize the algorithm. For any sample, its nearest samples are first determined by Euclidean distance as the nearest neighbor set, and then samples that meet the mutual nearest neighbor condition are extracted from it to form the mutual nearest neighbor set. Combining this relationship improves the local density calculation, distance measurement and sample allocation strategy, thereby enhancing the adaptability to the size differences of distribution network equipment.

[0058] A method for identifying UAV-based power distribution network equipment based on neighboring density peak clustering is presented in this embodiment, taking the inspection of a 10kV power distribution line as an example. Figure 2 As shown, the specific steps include:

[0059] Step S1: Obtain the original RGB image of the power distribution line using a drone;

[0060] Furthermore, under clear weather conditions, RGB images of the 10kV line are acquired using drones. The acquired RGB images must cover typical environments such as mountainous forest areas, plain farmland, and suburban building complexes, and fully present power distribution network equipment such as poles, transformers, insulators, clamps, and surge arresters. Images of poor quality or those that cannot effectively identify equipment features are discarded.

[0061] Step S2: Based on grayscale structural similarity measurement, quantify the structural similarity between the R, G, and B channels and the original RGB image, and output the contrast feature coefficients of each channel by normalizing the sum of the three channel scores.

[0062] Furthermore, based on the differences in human eye sensitivity to the RGB three channels and the color characteristics of power distribution network equipment and background, this step combines the grayscale structure similarity measure C2G-SSIM to construct contrast feature coefficients to better preserve the contrast features of the original color image. This assumes the input image... Output the contrast characteristic coefficients of each channel in RGB format. The formula for calculating the contrast characteristic coefficient includes:

[0063] ;

[0064] ;

[0065] ;

[0066] in, , , These are the contrast characteristic coefficients for the R, G, and B channels. , , , This is a sub-graph corresponding to the single channels of R, G, and B. , , These correspond to the average gray-level structural similarity scores of single-channel R, G, and B images, respectively. Gray-level structural similarity measures include brightness similarity, contrast similarity, and structural similarity, which are used to construct contrast feature factors to better preserve the detailed features of the original color image. The range of values ​​is The higher the value, the more consistent the image structure preserved by that channel is with the original image. The sum of the scores for the R, G, and B channels is used for feature coefficient normalization.

[0067] Step S3: Define the single-channel saturation feature as the absolute difference between the corresponding channel pixel and the mean of the three channels, construct a saturation retention term based on the L2 norm, and constrain the matching relationship between grayscale difference and saturation difference;

[0068] Furthermore, to improve the ability of grayscale images to retain details of power distribution network equipment, this step introduces a saturation feature preservation mechanism to prevent pixels with high saturation differences from being mapped to similar grayscale values. The calculation formula for single-channel saturation features is as follows:

[0069] ;

[0070] in, It is a single-channel saturation feature. For the corresponding channel pixels, ;

[0071] A saturation feature preservation term is constructed based on the L2 norm to constrain the matching relationship between grayscale differences and saturation differences. This can prevent pixels with high saturation differences from losing details due to grayscale mapping. The calculation formula for the saturation preservation term includes:

[0072] ;

[0073] ;

[0074] in, Saturation retention term This is the grayscale mapping function. , For channel pixels , The corresponding value in the grayscale image, , It is a set containing both local and non-local candidate pixel pairs. , For channel pixels , The absolute difference from the three-channel mean , , Let be the channel weight coefficients to be solved, satisfying the constraints. ;

[0075] Step S4: Calculate the contrast feature preservation term by combining the contrast feature coefficients, introduce the saturation preservation term, construct the total energy function, and use a discrete search strategy to solve for the channel weight coefficients that satisfy the minimization of the total energy function, and output the initial grayscale image.

[0076] Furthermore, the formula for calculating the contrast feature preservation term is:

[0077] ;

[0078] in, For contrast feature preservation terms based on Gaussian distribution, As a constant greater than 0, in this embodiment, the Gaussian kernel bandwidth can be set to... ( Take 0.8). These are the contrast characteristic coefficients corresponding to a single channel. , For the corresponding channel pixels , The value of , This is the absolute value operator, which automatically selects the sign based on the distance between pixel pairs;

[0079] To efficiently solve for the total energy function Minimizing channel weight coefficients: This step employs a discrete search strategy to select the combination that minimizes the total energy function as the optimal channel weights. The final output is the optimal initial grayscale image, mapping pixels with significant saturation differences to different grayscale values, thus aligning with the characteristics of human visual perception. The formula for calculating the total energy function is: ;

[0080] in, Let be the total energy function. To balance the adjustment parameters of different energy terms, this embodiment... ;

[0081] Discrete search strategies specifically include: , , The value range is discretized into 10 intervals with a step size of 0.1. Each weight coefficient generates 11 candidate values. All candidate combinations that satisfy the weight coefficient and constraints are traversed, and the combination that minimizes the total energy function is selected as the optimal channel weight.

[0082] Step S5: Using the original RGB image as the guide image, calculate the 3×3 neighborhood variance of the pixels, dynamically adjust the filtering weights based on the variance, construct a least squares loss function with regularization parameters to optimize the parameters, remove noise and retain the device edge contours, and output the weighted guided filtering grayscale image.

[0083] Furthermore, to address noise interference and edge blurring issues in the image, this step employs weighted guided filtering to improve the clarity of key structures of power distribution equipment in the grayscale image. Using the original RGB image as the guide image, the filtering weights are adjusted by calculating the variance information within the pixel neighborhood window. Weighting refers to dynamically adjusting the filtering weights based on pixel neighborhood features. Guided filtering is a filtering method using the original RGB image as the guide image. The expression for the filtering weight function is as follows:

[0084] ;

[0085] in, Here is the filter weight function. For pixels The variance within the surrounding 3×3 neighborhood reflects the texture complexity within the corresponding region. For pixels The variance within the surrounding 3×3 neighborhood, The total number of pixels in the guide map. To prevent constants with a denominator of zero, the value is taken as... , For summation, To sum the variables, iterate through all pixels in the guide graph, from 1 to... , indicating to The corresponding items are summed up. This represents traversing each pixel in the guide graph, sequentially referring to the 1st pixel, 2nd pixel, and so on, up to the 1st pixel. 1 pixel, It serves as both a pixel identifier and a counting variable for summation, used to iterate through all pixels to complete the accumulation operation;

[0086] The filtering process optimizes parameters by constructing a loss function, enabling the output image to smooth noise while preserving edge details. The formula for the least squares loss function is:

[0087] ;

[0088] in, The least squares loss function is used. For the current filtering window, , These are the linear coefficients within the filtering window. To input grayscale image pixel values, This is the regularization parameter, with a value of 0.01. To guide the pixel values, the input in this process is the initial grayscale image obtained through a discrete search operation. The base grayscale image is obtained through weighted guided filtering. Then the detailed diagram can be represented as The detail image is fused with the initial grayscale image to generate the final weighted guided-filter grayscale image. ;

[0089] Step S6: Perform an erosion operation on the enhanced grayscale image using a 3×3 rectangular structuring element to eliminate noise, and then perform a dilation operation to expand the device boundary and repair the broken edges of the device. After that, use structuring elements of increasing size of 3×3, 5×5, and 7×7 in sequence to iteratively perform open reconstruction (erosion followed by dilation) and closed reconstruction (dilation followed by erosion) operations to output a morphologically reconstructed enhanced grayscale image.

[0090] Furthermore, after weighted guided filtering, although the image achieves noise suppression and edge preservation, subtle edge breaks or residual minor noise may still exist. To further optimize the equipment contour, this step introduces morphological reconstruction, an image filtering method. Iterative opening and closing reconstruction filtering is performed using structural elements from small to large, generating a morphologically reconstructed enhanced grayscale image with uniform grayscale features and easier segmentation. This method can adapt to the processing needs of multi-morphological targets in power distribution network equipment. The morphological reconstruction operations include erosion and dilation. The erosion operation shrinks the equipment boundary, thereby eliminating minor noise attached to the edges and refining the contour. The dilation operation expands the equipment boundary, thereby repairing edge breaks that may occur after erosion and connecting subtle broken parts to restore the equipment's structural shape. The expression for the erosion operation is: The expression for the expansion operation is: ,in, The image after erosion. The image after dilation. This is the grayscale image after weighted guided filtering. It is a 3×3 rectangular structuring element. , This operation, which calculates the minimum value of neighboring pixels, can remove "burrs" caused by noise on the surface of large targets and eliminate isolated noise around small targets. To perform the calculation by taking the maximum value of neighboring pixels, this operation can repair wire breaks, connect the edges of insulator skirts, fill transformers, and fill tiny gaps inside wire clamps;

[0091] Specifically, this step, based on morphological reconstruction, involves eroding the image. For labeled images, weighted guided filter images As a mask, an open reconstruction was performed three times using rectangular structuring elements that gradually increased in size from 3×3 to 5×5 to 7×7, to dilate the image. For labeling, the mask image is used in the same way as the opening reconstruction step, and the closing reconstruction is performed using the same structuring element strategy to obtain the final morphologically reconstructed enhanced grayscale image. This operation can remove part of the background while suppressing Gaussian and salt-and-pepper noise, thus improving image segmentation accuracy.

[0092] Step S7: Convert the morphologically reconstructed and enhanced grayscale image to Lab space, calculate the Sobel gradient map, select the gradient minimum region as the seed node, set the color threshold and texture threshold, divide the superpixel blocks according to feature similarity, iteratively optimize the boundary pixel assignment, and output the superpixel segmentation image.

[0093] Furthermore, morphological reconstruction is processed at the pixel level, which still has computational redundancy. To reduce the complexity of subsequent feature extraction, this step enhances the grayscale image of the morphological reconstruction. Superpixel segmentation is performed by dividing local regions with similar features, which simplifies computation while preserving device structural features. The gradient calculation expression is as follows: ,in, For gradient, , , For the Lab color channel components of the image, , , The edge gradients calculated and extracted for each channel using Sobel (3×3 neighborhood edge detection filter) are used to describe the color and texture changes between pixels;

[0094] Specifically, after calculating the gradient to capture pixel differences, the minimum region of the gradient image is used as the initial seed node, and the seed node set is as follows: The set of seed nodes satisfies: ,in, For pixels The eight adjacent pixels in the top, bottom, left, right and four diagonal directions. Represents the pixel coordinates within the neighborhood;

[0095] Based on seed node Expand the region and set a threshold. Traversing the gradient extreme value interval ,according to Increasing order defines the region For each pixel, calculate the difference between its color and the mean color of the seed node. Difference from texture variance ,when and If the pixel is similar to the seed node, it is merged into the same superpixel block. For color threshold, Texture threshold, color threshold Values The texture threshold is set to 1. ;

[0096] like Figure 3 As shown, after dividing the superpixel blocks, a maximum number of iterations can be set. After each iteration, the mean value of features within the block is recalculated to optimize the assignment of boundary pixels. The process terminates when the change rate of the superpixel block boundary is less than 1% for two consecutive iterations, resulting in the final generated superpixel segmentation image. ;

[0097] Step S8: Perform two-dimensional wavelet decomposition on the superpixel segmented image to generate smooth sub-images and detail sub-images. Calculate the mean and variance of the wavelet decomposition coefficients of each sub-image and construct the feature vector and feature dataset.

[0098] Furthermore, wavelet refers to a two-dimensional mother wavelet function used for image decomposition. It satisfies the admissibility condition through Fourier transform, possesses time-frequency domain local analysis capabilities and direction selectivity, and can decompose an image into sub-images of different resolutions and directions. This meets the requirements for extracting multi-scale textures and contours from power distribution network equipment. The two-dimensional wavelet decomposition operation is implemented through convolution operations, and its expression is: ,in, This represents the wavelet coefficients of the superpixel segmented image after undergoing a two-dimensional wavelet transform. It is a two-dimensional wavelet transform operator, which works by interacting with the two-dimensional mother wavelet function. The convolution operation extracts frequency domain features (such as details and edges) of the superpixel segmented image at different scales and locations. These features are derived from wavelet coefficients. Quantization is the foundation for subsequent operations such as frequency domain filtering and image analysis. To segment the grayscale distribution in an image using superpixels, It is a two-dimensional convolution operator. Given a two-dimensional mother wavelet function, after wavelet decomposition, column downsampling and row downsampling can be combined to generate smooth sub-images, horizontal detail sub-images, vertical detail sub-images, and diagonal detail sub-images. The smooth sub-images reflect the overall outline of the equipment, while the detail sub-images are used to extract texture features in different directions. The mean and variance calculation process is as follows: select a symmetrical, tightly supported orthogonal wavelet, and calculate the mean of the wavelet decomposition coefficients for each sub-image. With variance , to obtain the feature vector The feature vectors of all images are integrated into a set X, where, This represents the mean of the wavelet decomposition coefficients of the smoothed subgraph. The smoothed subgraph is the image after wavelet decomposition, preserving low-frequency information and reflecting the overall appearance of the image. This mean reflects the average level of the smoothed subgraph coefficients. The variance represents the wavelet decomposition coefficients of the smoothed subgraph. Variance reflects the dispersion of the smoothed subgraph coefficients, i.e., how the coefficients fluctuate around the mean, and can reflect characteristics such as the uniformity of the distribution of information in the smoothed subgraph. This represents the mean of the wavelet decomposition coefficients of the horizontal detail submap. The horizontal detail submap mainly contains detailed information in the horizontal direction of the image, and this mean is the average size of the coefficients in the horizontal detail submap. The variance of the wavelet decomposition coefficients of the horizontal detail submap is used to measure the dispersion of the coefficients in the horizontal detail submap and reflects the fluctuation of the distribution of detail information in the horizontal direction. The mean value is the wavelet decomposition coefficient of the vertical detail submap. The vertical detail submap carries detailed information in the vertical direction of the image, and this mean value is the average level of the coefficients of the vertical detail submap. The variance of the wavelet decomposition coefficients of the vertical detail submap reflects the dispersion of the coefficients and indicates the distribution fluctuation characteristics of detail information in the vertical direction. The mean value is the wavelet decomposition coefficient of the diagonal detail submap, which contains detail information in the diagonal direction of the image. This mean value is the average size of the diagonal detail submap coefficients. The variance of the wavelet decomposition coefficients of the diagonal detail submap measures the dispersion of the coefficients and reflects the distribution fluctuation of detail information in the diagonal direction.

[0099] Specifically, to improve the reliability of feature extraction, this method removes noise and preserves edges through weighted guided filtering, optimizes edges through dilation and erosion, and simplifies images through superpixel segmentation. This can compress pixel size while ensuring the integrity of the local structure of the device and reduce the computational complexity of feature extraction.

[0100] Step S9: Determine the number of nearest neighbors for each sample using Euclidean distance, and obtain the mutual nearest neighbor set composed of mutually nearest neighbor samples, and the shared mutual nearest neighbor set composed of the intersection of the mutual nearest neighbors of any two samples.

[0101] Furthermore, to address the issue of feature imbalance between large and small devices in traditional local density calculations, a sample-based approach is used. Neighborhood builds mutual Nearest neighbor relationship, for any sample First, use Euclidean distance to find the nearest... The sample was determined to be... Nearest neighbor set Then extract from this set the sets that satisfy the condition that the two sets are mutually exclusive. Nearest neighbor condition samples They form a set of nearest neighbors. The more samples a sample has in its nearest neighbor set, the greater the probability that the sample belongs to a dense region. In this embodiment, the number of nearest neighbors is selected. For 2% of the total sample size, the shared nearest neighbor set is ;

[0102] Step S10: Calculate the local density and relative distance of all samples, normalize the two and multiply them, and select the samples with the largest product as cluster centers.

[0103] Furthermore, when the selected sample has the maximum non-local density, the sum of the Euclidean distances from the corresponding sample to the sample with the greater local density and its nearest neighbors is calculated. The minimum value of the mean distance is taken as the relative distance. Otherwise, the relative distance is the maximum value of the relative distances of other samples. Based on the relative distance, the local density of all samples is normalized and multiplied by the relative distance to obtain the decision value. The decision values ​​are arranged in descending order, and the first few samples with index values ​​are selected as cluster centers.

[0104] Specifically, the formula for calculating local density is:

[0105] ,in, For local density, The total number of samples, For each neighbor set, For the sample The number of samples in the nearest neighbor set, This is an indicator function; if the internal result is greater than 0, it takes the value 1; otherwise, it takes the value 0. For the sample With sample The distance between them For the sample With sample The distance between them express Samples are sets of mutual nearest neighbors. The local density is defined as the number of samples contained within a circular region centered at itself and with the sum of its nearest neighbor distances as its radius. From the formula, we can see that the sample density is... The more neighboring samples a device has, the greater its local density, and vice versa. This operation can prevent large devices from excessively affecting the calculation or small devices from being ignored.

[0106] When sample When the nonlocal density is maximized, calculate the sample To samples with higher local density and The minimum of the mean Euclidean distances between nearest neighbors is taken as the relative distance. The formula for calculating relative distance is: ,sample The relative distance of one sample is the maximum relative distance of the other samples. When searching for cluster centers, the decision value is obtained by multiplying the normalized local density and relative distance of all samples. The calculation formula is: ,in, This represents the maximum value of the attribute. To determine the minimum attribute value, a threshold is set based on the decision value. All samples with values ​​higher than this threshold are selected as cluster centers.

[0107] Step S11: Divide the neighboring samples of each cluster center into the corresponding clusters, and then allocate the remaining samples according to the shared neighboring similarity to obtain the identification results of the power distribution network equipment.

[0108] Furthermore, the allocation process for the remaining samples specifically includes:

[0109] Assign the same category label to the nearest neighbor samples of each cluster center;

[0110] The remaining unclassified samples are assigned to the cluster of the assigned sample with the highest similarity, until all samples are assigned or there is no similarity between samples;

[0111] If the highest similarity between samples is 0, and there are still unassigned samples, then the corresponding sample category is marked as the one closest to it. The mode category of the assigned nearest neighbors, The number of nearest neighbors;

[0112] If multiple categories have the same highest score in the nearest neighbor voting, the allocation strategy of the DPC algorithm is used to assign the sample to the cluster to which the nearest sample belongs with a higher local density.

[0113] Specifically, the original allocation strategy of the DPC algorithm is a single-step allocation strategy, which is prone to cascading errors and increases the probability of small devices failing to identify the samples. To avoid this problem, this step defines shared neighbors based on the intersection of the sets of mutual neighbors of two samples, and designs a multi-step allocation strategy for samples. The similarity between samples with shared neighbors is used as the basis for non-clustering center allocation. The similarity calculation formula is as follows:

[0114] , Representative sample With sample The number of samples in the shared set of mutual nearest neighbors.

[0115] In summary, this method dynamically allocates channel weights through grayscale structure similarity measurement, constructs a total energy function by combining single-channel saturation feature definition and L2 norm constraint, and uses a discrete search strategy to solve for the optimal weight combination, preserving key details of distribution network equipment. Through weighted guided filtering, morphological reconstruction, and superpixel segmentation, it enhances equipment edges while removing noise, simplifies the computational scale of image feature extraction, and uses the equipment feature vector extracted by two-dimensional wavelet transform as input. It utilizes various nearest neighbor information to optimize local density calculation, relative distance measurement, and sample allocation strategies, adapting to multi-scale equipment classification in distribution networks. This method can effectively solve problems such as detail loss, noise interference, edge breakage, and chaotic classification of multi-scale equipment under complex lighting conditions, effectively improving the recognition accuracy and efficiency of UAV inspection.

[0116] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for identifying power distribution network equipment of a UAV based on mutual nearest neighbor density peak clustering, characterized in that, Specifically comprising the following steps: Step S1, obtaining an original RGB image of a power distribution line by a UAV; Step S2, quantifying the structural similarity of R, G and B channels with the original RGB image based on a gray structure similarity metric, and outputting the contrast feature coefficients of each channel through three-channel score summation normalization processing; Step S3, defining a single-channel saturation feature as the absolute difference between the corresponding channel pixel and the three-channel mean, and constructing a saturation reservation term based on the L2 norm to constrain the matching relationship between the gray difference and the saturation difference; Step S4, combining the contrast feature coefficient to calculate the contrast feature retention term, introducing the saturation reservation term, constructing a total energy function, and using a discrete search strategy to solve the channel weight coefficient that satisfies the minimization of the total energy function, and outputting an initial gray image; Step S5, taking the original RGB image as a guide image, calculating the 3x3 neighborhood variance of the pixel, dynamically adjusting the filtering weight according to the variance, constructing a least squares loss function with a regularization parameter to optimize the parameters, removing noise and retaining the device edge contour, and outputting a weighted guide filtered gray image; Step S6, performing an erosion operation on the enhanced gray image with a 3x3 rectangular structure element to eliminate noise, and then performing a dilation operation to expand the device boundary, repair the device edge breakage, and then iteratively perform open reconstruction and close reconstruction operations with increasing structure elements of 3x3, 5x5 and 7x7, and output a morphological reconstruction enhanced gray image; Step S7, converting the morphologically reconstructed enhanced gray image to Lab space, calculating the Sobel gradient map, selecting the gradient minimum value region as the seed node, setting the color threshold and texture threshold, dividing the superpixel block according to the feature similarity, and iteratively optimizing the boundary pixel attribution, and outputting a superpixel segmentation image; Step S8, performing a two-dimensional wavelet decomposition operation on the superpixel segmentation image to generate a smooth subgraph and a detail subgraph, calculating the mean and variance of the wavelet decomposition coefficients of each subgraph, and constructing a feature vector and a feature dataset; Step S9, determining the number of nearest neighbors of each sample by Euclidean distance, obtaining a mutual neighbor set composed of mutual neighbors of each sample, and a shared mutual neighbor set composed of the intersection of mutual neighbors of any two samples; Step S10, calculating the local density and relative distance of all samples, multiplying the normalized values, and selecting a number of samples with the maximum product as the clustering centers; Step S11, dividing the mutual neighbor samples of each clustering center into corresponding clusters, and then distributing the remaining samples according to the shared mutual neighbor similarity to obtain the identification result of the power grid device. 2.The method of claim 1, wherein, The calculation formula of the contrast feature coefficient in step S2 includes: In step S3, the calculation formula of the single-channel saturation feature is: ; ; ; wherein, , , is the contrast feature coefficient of R, G, B single channel, , , , is the corresponding subgraph of R, G, B single channel, , , respectively correspond to the average gray structure similarity score of R, G, B single channel image, and the gray structure similarity measure includes brightness similarity, contrast similarity and structure similarity, is the total score of R, G, B three channels. 3.The method of claim 2, wherein, The calculation formula of the saturation reservation term includes: ; wherein, is a single channel saturation characteristic, is a corresponding channel pixel, ; In step S5, the expression of the filtering weight function is: ; ; wherein, is a saturation preserving term, is a gray scale mapping function, , is a channel pixel , is a corresponding value in a gray scale image, , is a set containing pairs of local and non-local candidate set pixels, , is a channel pixel , is an absolute difference to a three channel mean, , , is a channel weight coefficient to be solved, satisfying the constraint . 4.The method of claim 3, wherein, In the step S4, the calculation formula of the contrast feature preserving term is: ; wherein, is a contrast feature preserving term based on a Gaussian distribution, is a constant greater than 0, is a contrast feature coefficient for the corresponding single channel, , is a pixel value of the corresponding channel , . The formula for calculating the total energy function is: ; wherein, is the total energy function, is an adjustment parameter balancing the different energy terms; The discrete search strategy specifically includes: discretizing the value range of the , , by a step of 0.1 into 10 intervals, generating 11 candidate values for each weight coefficient, traversing all candidate combinations satisfying the weight coefficient and constraint, and screening the combination that minimizes the total energy function as the optimal channel weight. 5.The method of claim 1, wherein, ​ ; wherein, is a filter weight function, is a pixel variance in a 3x3 neighborhood around the pixel, reflecting the texture complexity in the corresponding region, is a pixel variance in a 3x3 neighborhood around the pixel, is the total number of pixels of the guide map, is a constant to prevent the denominator from being zero, taking the value ; The formula of the least square loss function is: ; wherein, is a least square loss function, is a current filter window, , is a linear coefficient within the filter window, is an input grayscale image pixel value, is a regularization parameter, is a guided image pixel value. 6.The method of claim 1, wherein, The morphological reconstruction operation in the step S6 includes an erosion operation and a dilation operation, the expression of the erosion operation is: , and the expression of the dilation operation is: , wherein, is the image after erosion, is the image after dilation, is the gray image after weighted guided filtering, is a 3*3 rectangular structure element, , is a minimum value operation of neighborhood pixels, is a maximum value operation of neighborhood pixels. 7.The method of claim 1, wherein, The basis for dividing the super-pixel block in step S7 is to calculate the difference between the color mean value of each pixel and the seed node the difference from the texture variance When and then the pixel is determined to be similar to the seed node and merged into the same super-pixel block, is the color threshold value, is the texture threshold value. 8.The method of claim 1, wherein, In the step S8, the two-dimensional wavelet decomposition operation is realized by a convolution operation, expressed as: wherein, represents the wavelet coefficients of the superpixel segmented image after two-dimensional wavelet transform, is a two-dimensional wavelet transform operator, is a gray scale distribution in the superpixel segmented image, is a two-dimensional convolution operator, is a two-dimensional mother wavelet function. 9.The method of claim 1, wherein, In the step S10, when the selected sample is not the local density maximum, the Euclidean distance between the selected sample and the sample with larger local density and the nearest neighbor is calculated, the minimum of the distance average is taken as the relative distance, otherwise the relative distance is the maximum of the relative distances of other samples, the local density of all samples is multiplied by the relative distance after normalization, the decision value is obtained, the decision value is arranged in descending order, and the first several samples with index values are selected as the clustering centers. 10.The method of claim 1, wherein, The allocation process of the remaining samples specifically includes: The mutual nearest neighbor samples of each clustering center are given the same class label as the clustering center; The remaining samples not yet divided are classified into the class cluster to which the sample with the highest similarity belongs, until all samples are allocated or there is no similarity between samples; If the highest similarity between samples is 0, and there are still unassigned samples, then the corresponding sample class is labeled as the mode class of the nearest assigned neighbors, is the number of neighbors. If the multi-class scores in the nearest neighbor voting are the highest, the allocation strategy of the DPC algorithm is followed, and the sample is allocated to the class cluster to which the nearest sample with larger local density belongs.

Citation Information

Patent Citations

  • Reservoir bank slope crack identification method based on unmanned aerial vehicle inspection and digital image

    CN119477904A

  • Steel bar corrosion degree detection method based on quantum image processing algorithm

    CN120451119A