A Deep Learning-Based Method and System for Automatic Identification and Classification of Defects in Power Distribution Network Towers

By employing deep learning methods, combined with local contrast enhancement and multi-scale feature fusion, the problem of efficient identification and classification of defects in power distribution network towers under complex environments was solved, achieving high-precision and efficient defect detection.

CN121564557BActive Publication Date: 2026-04-17SICHUAN YAAN ELECTRIC POWER (GRP) CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SICHUAN YAAN ELECTRIC POWER (GRP) CO LTD
Filing Date
2026-01-22
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently identify and classify multi-scale defects, especially minute defects, in distribution network towers under complex environments, and they consume significant computational resources, making it difficult to meet the dual requirements of real-time performance and accuracy.

Method used

A deep learning-based approach is adopted, which uses a convolutional neural network to locate the main body area of ​​the tower. It combines a local statistical characteristic contrast enhancement algorithm and a pyramid dispersion attention module, integrates multi-scale spatial information and channel attention, introduces a two-dimensional selective state space module and an adaptive anchor box mechanism to enhance defect edge features, and finally uses a multi-branch prediction structure for defect identification and classification.

Benefits of technology

It significantly improves the accuracy and robustness of defect detection in complex environments, can accurately identify multi-scale defects, optimizes the allocation of computing resources, and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121564557B_ABST
    Figure CN121564557B_ABST
Patent Text Reader

Abstract

This invention relates to a method and system for automatic identification and classification of defects in power distribution network towers based on deep learning. The method first uses a convolutional neural network to locate and extract the main area of ​​the tower, eliminating background interference. Then, an adaptive contrast enhancement algorithm based on local statistical characteristics is employed to improve the visual saliency of the defect area. In the feature extraction stage, a pyramid-shaped distraction attention module is introduced to fuse multi-scale spatial information and channel attention, and a two-dimensional selective state space module is used to model long-range dependencies. Furthermore, a hierarchical feature fusion architecture and an adaptive anchor box mechanism are used to aggregate multi-resolution features and match targets of different sizes. Finally, an adaptive edge enhancement module is used to strengthen defect edges, and a multi-branch detection head performs parallel defect category determination, location regression, and confidence assessment. This effectively improves the detection accuracy and robustness of tower defects in complex backgrounds, and is particularly suitable for the automatic identification of small-scale defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent operation and maintenance technology for power facilities, and in particular to a method and system for automatic identification and classification of defects in distribution network towers based on deep learning. Background Technology

[0002] As a critical infrastructure for power transmission, the structural integrity of power distribution network towers directly affects the safe and stable operation of the power grid. Due to long-term exposure to complex natural environments, tower surfaces are prone to various defects such as corrosion, cracks, and insulator damage. Traditional manual inspection methods are not only inefficient and costly, but also limited by the subjective experience of inspectors and environmental conditions, making comprehensive and accurate defect identification difficult, especially for towers in high-altitude or remote areas where inspection is even more challenging.

[0003] In recent years, with the development of computer vision technology, image-based automatic detection methods have been gradually applied to pole and tower inspection. However, existing methods still face many challenges: First, pole and tower images taken in the field have complex backgrounds, with problems such as changes in lighting, occlusion, and vegetation interference, which seriously affect the extraction and recognition of target areas; second, defects have diverse shapes and large scale differences, especially small defects with weak features, and traditional image processing methods have insufficient generalization ability, which easily leads to missed detections and false detections; in addition, most deep learning models are difficult to effectively capture long-range spatial dependencies, lack sensitivity to defect types with blurred edges and complex textures, and consume a lot of computational resources, making it difficult to meet the dual requirements of real-time performance and accuracy in practical engineering.

[0004] Therefore, there is an urgent need for an automated detection solution that can adapt to complex environments, accurately identify multi-scale defects, and is computationally efficient, in order to meet the pressing needs of modern smart grids for efficient perception and intelligent operation and maintenance of tower conditions. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention aims to provide a method and system for automatic identification and classification of defects in power distribution network poles and towers based on deep learning, which can achieve high-precision, automated, and intelligent detection of defects in power distribution network poles and towers.

[0006] In a first aspect, embodiments of this application provide a method for automatic identification and classification of defects in power distribution network towers based on deep learning, the method comprising:

[0007] Step S1: Use a convolutional neural network to preprocess the input power distribution network tower image, locate the main area of ​​the tower and extract its minimum bounding rectangle to eliminate background interference;

[0008] Step S2: Apply a contrast enhancement algorithm based on local statistical characteristics to the main area of ​​the tower. By calculating the gray-scale distribution characteristics of the local area of ​​the image, the pixel contrast is adaptively adjusted to enhance the visual salience of the defect area while suppressing background noise.

[0009] Step S3: Use the pyramid distributed attention module to group the feature maps, fuse multi-scale spatial information and channel attention weights, and introduce a channel attention mechanism into the feature extraction network to enhance attention to defective regions and optimize the allocation of computing resources;

[0010] Step S4: Introduce a two-dimensional selective state space module to model the feature sequence and capture long-range dependencies; at the same time, introduce a hierarchical feature fusion architecture in the detection network, aggregate feature maps of different resolutions through cross-level upsampling and downsampling paths, and use an adaptive anchor box mechanism to match defect targets of different sizes to improve the detection capability of micro-scale defects.

[0011] Step S5: Enhance the edge features of defects by using an adaptive edge enhancement module to improve the accuracy of boundary recognition; and use a detection head with a multi-branch prediction structure to process the enhanced image. By outputting the prediction results on feature maps of different scales in parallel, the defect category determination, location regression and confidence assessment are realized, and the automatic identification and classification of various tower defects are completed.

[0012] Optionally, in one implementation of the first aspect of the present invention, the positioning and extraction of the main tower area in step S1 specifically includes:

[0013] A lightweight convolutional neural network is used as the backbone network to extract features from the input power distribution network tower images and generate multi-scale feature maps.

[0014] An anchor box mechanism is used on the feature map to predict candidate bounding boxes for the main body region of the tower, and redundant boxes are removed by a non-maximum suppression algorithm.

[0015] Coordinate regression optimization is performed on the retained candidate bounding boxes to accurately fit the main area of ​​the tower;

[0016] Based on the optimized bounding box coordinates, the corresponding tower main body area image is cropped and extracted from the original image, and uniformly scaled to a preset size for subsequent processing.

[0017] Optionally, in one implementation of the first aspect of the present invention, the enhancement algorithm in step S2 specifically includes:

[0018] S2.1: Convert the extracted image of the main tower area to the HSV color space, separate the luminance component V for enhancement processing, and retain chroma and saturation information;

[0019] S2.2: Divide the luminance component into several local sub-blocks, and calculate the local mean and standard deviation of the pixels in each sub-block;

[0020] S2.3: Based on the aforementioned local statistical characteristics, the contrast of each pixel is dynamically adjusted using an adaptive gain function, wherein the gain coefficient is positively correlated with the local standard deviation and negatively correlated with the local mean.

[0021] S2.4: Merge the enhanced luminance component with the original chroma and saturation components, convert them back to the RGB color space, and output the enhanced image of the main tower area.

[0022] Optionally, in one implementation of the first aspect of the present invention, the calculation of the adaptive gain function in step S2.3 further incorporates global contrast optimization based on the ACE algorithm, specifically including:

[0023] a) After completing the contrast adjustment based on local statistical characteristics, the enhanced luminance component... Further calculation of each pixel Global contrast response value :

[0024] , ,

[0025] in, For pixels in the ACE algorithm The original global contrast response value is obtained by weighted summation of pixel differences within the neighborhood; The value represents the luminance component after adjustment by the adaptive gain function in step S2.3, where Ω is the image domain. This is a slope function used to enhance local differences. and Each pixel and brightness value, The Euclidean distance between two pixels. Represents pixels The local neighborhood;

[0026] b) Normalize to the interval [0,1]:

[0027] ,

[0028] in, This is the global contrast response value calculated using the ACE algorithm. and Each of the following is a separate section of the entire image. The minimum and maximum values;

[0029] c) Further adjust image contrast by optimizing the objective function:

[0030] ,

[0031] in, The weighting function is, i.e. M is the normalization factor. ,

[0032] d) Enhanced The enhanced luminance component is obtained by weighted fusion with the luminance value adjusted by the adaptive gain function in step S2.3. :

[0033] ,

[0034] in, This represents the final enhanced luminance component value. For fusion weighting coefficients;

[0035] e) will It is merged with the original chroma and saturation components and converted back to the RGB color space.

[0036] Optionally, in one implementation of the first aspect of the present invention, the multi-scale feature extraction and attention enhancement in step S3 specifically includes:

[0037] S3.1: Extract multi-level feature maps of the main area image of the tower using the backbone network;

[0038] S3.2: Divide the feature map into S groups along the channel dimension;

[0039] S3.3: Perform convolution operations at different scales on each set of features to extract multi-scale spatial features;

[0040] S3.4: Apply the squeeze-excited SE attention module to each group of features to generate the channel attention weight vector for each group;

[0041] S3.5: Use the Softmax function to normalize the channel attention weight vectors generated in each group to obtain the recalibrated multi-scale channel weights;

[0042] S3.6: Perform channel-by-channel multiplication on the recalibrated weights and the corresponding multi-scale feature maps to enhance the feature response related to defects;

[0043] S3.7: Concatenate multiple weighted feature maps along the channel dimension to output an enhanced multi-scale feature representation.

[0044] Optionally, in one implementation of the first aspect of the present invention, step S3.4: applying the squeeze-excited SE attention module to each group of features to generate channel attention weight vectors for each group, including:

[0045] S3.4.1: For each set of feature maps Perform global average pooling to compress the spatial dimension and generate channel-level global descriptors. The calculation formula is as follows:

[0046] ,

[0047] in: Indicates the feature map at location The value at; H represents the number of channels, and H and W represent the height and width of the feature map, respectively. This is the scalar result after global average pooling of the c-th channel;

[0048] S3.4.2: Set the global descriptor The input consists of two fully connected layers with a bottleneck structure. The first fully connected layer reduces the dimension to [value missing]. Where r is the reduction ratio, and the ReLU activation function is used; then the dimension is restored to through a second fully connected layer. Channel attention weights are generated using the Sigmoid activation function. The calculation formula is as follows:

[0049] ,

[0050] in, and δ represents the weight parameters of the fully connected layer, where δ represents the ReLU activation function and σ represents the Sigmoid activation function.

[0051] S3.4.3: Generate channel attention weights As the attention weight vector of this set of feature maps;

[0052] S3.4.4: The weight vector is fused with the original feature map through channel-by-channel multiplication to obtain the enhanced feature map.

[0053] Optionally, in one implementation of the first aspect of the present invention, step S3.5: normalizing the channel attention weight vectors generated in each group using the Softmax function to obtain recalibrated multi-scale channel weights, including:

[0054] The channel attention weight vectors corresponding to the S groups of feature maps are concatenated to form a multi-scale channel attention weight vector, where the total number of channels after concatenation is S multiplied by the number of original channels in each group.

[0055] The Softmax function is applied to the concatenated weight vector to map it to a probability distribution, resulting in the recalibrated multi-scale channel weights. The normalized channel attention weights corresponding to the i-th feature map are calculated by the ratio of the exponent of the weight vector of that group to the sum of the exponents of all weight vectors.

[0056] Optionally, in one implementation of the first aspect of the present invention, step S4 specifically includes the following sub-steps:

[0057] S4.1: A two-dimensional selective state space module is introduced to model the long-range dependencies of the feature sequences extracted by the backbone network. The module selectively scans the context information in the image space through learnable parameters. Its state space representation is jointly defined by the hidden state at the current time, the input features, and the learnable parameter matrix generated by the evolution of the control state, the input projection, and the output.

[0058] S4.2: Construct a hierarchical feature fusion architecture, which aggregates feature maps of different resolutions through cross-level upsampling and downsampling paths. Specifically, it includes adding deep semantic features to shallow high-resolution features element-wise through bilinear upsampling, and using one-to-one convolution to align and fuse the channel dimensions.

[0059] S4.3: An adaptive anchor box mechanism is adopted to dynamically match defect targets of different sizes. For each feature map layer, the width and height of the real labeled boxes in the training set are clustered according to the receptive field size and resolution to generate the prior anchor box size. The weight of the anchor box size is dynamically adjusted according to the intersection-union ratio of the predicted box and the real box.

[0060] S4.4: The feature map enhanced by the two-dimensional selective state space module is input into the hierarchical fusion architecture, and the feature representation with rich multi-scale context information is output for subsequent defect classification and localization.

[0061] Optionally, in one implementation of the first aspect of the present invention, step S5 specifically includes the following sub-steps:

[0062] S5.1: Enhance defect edge features through an adaptive edge enhancement module, which uses a learnable convolutional kernel based on local image content adaptation for edge feature enhancement;

[0063] S5.2: Construct a detection head with a multi-branch prediction structure, which includes three parallel branches: the category prediction branch outputs the defect category probability distribution of each anchor box through a one-to-one convolution; the bounding box regression branch predicts the offset of each anchor box relative to the prior box; and the confidence evaluation branch outputs the confidence that each predicted box contains a defect target.

[0064] S5.3: Perform predictions in parallel on feature maps of different scales, and fuse deep semantic information with shallow detail information through a feature pyramid network to achieve the detection of defects of different sizes;

[0065] S5.4: End-to-end optimization is performed using a weighted multi-task loss function, which consists of three parts: classification loss, regression loss, and confidence loss. The contribution of each loss term is balanced by weighting coefficients.

[0066] S5.5: Redundant detection boxes are removed by a nonmaximum suppression post-processing algorithm, and the final defect identification and classification results are output.

[0067] Secondly, embodiments of this application provide a deep learning-based automatic identification and classification system for distribution network tower defects, applied to the deep learning-based automatic identification and classification method for distribution network tower defects as described in the second aspect. The system includes:

[0068] The tower main body area localization and extraction module is used to preprocess the input power distribution network tower image using a convolutional neural network, locate the tower main body area and extract its minimum bounding rectangle to eliminate background interference;

[0069] The local image enhancement module is used to apply a contrast enhancement algorithm based on local statistical characteristics to the main area of ​​the tower. By calculating the gray-level distribution characteristics of the local area of ​​the image, the pixel contrast is adaptively adjusted to enhance the visual salience of the defect area while suppressing background noise.

[0070] The multi-scale feature extraction and attention enhancement module is used to group feature maps using the pyramid distributed attention module, integrate multi-scale spatial information and channel attention weights, and introduce a channel attention mechanism into the feature extraction network to enhance attention to defective regions and optimize the allocation of computing resources.

[0071] The state space modeling and multi-scale feature fusion module is used to introduce a two-dimensional selective state space module to model feature sequences and capture long-range dependencies. At the same time, a hierarchical feature fusion architecture is introduced into the detection network, which aggregates feature maps of different resolutions through cross-level upsampling and downsampling paths, and adopts an adaptive anchor box mechanism to match defect targets of different sizes, thereby improving the detection capability of micro-scale defects.

[0072] The edge enhancement and defect classification and localization module is used to enhance the edge features of defects through an adaptive edge enhancement module, thereby improving the accuracy of boundary recognition. It also uses a detection head with a multi-branch prediction structure to process the enhanced image and outputs the prediction results on feature maps of different scales in parallel to achieve defect category determination, location regression and confidence assessment, thus completing the automatic identification and classification of various tower defects.

[0073] Thirdly, embodiments of this application provide an electronic device, including:

[0074] processor;

[0075] Memory used to store processor-executable instructions;

[0076] The processor is configured to implement the deep learning-based automatic identification and classification method for power distribution network tower defects as described in the first aspect when executing the instructions.

[0077] Fourthly, embodiments of this application provide a computer-readable storage medium storing a program that instructs a device to execute the deep learning-based automatic identification and classification method for power distribution network tower defects as described in the first aspect.

[0078] This invention relates to a method and system for automatic identification and classification of defects in power distribution network towers based on deep learning. The method first uses a convolutional neural network to locate and extract the main area of ​​the tower, eliminating background interference. Then, an adaptive contrast enhancement algorithm based on local statistical characteristics is employed to improve the visual saliency of the defect area. In the feature extraction stage, a pyramid-shaped distraction attention module is introduced to fuse multi-scale spatial information and channel attention, and a two-dimensional selective state space module is used to model long-range dependencies. Furthermore, a hierarchical feature fusion architecture and an adaptive anchor box mechanism are used to aggregate multi-resolution features and match targets of different sizes. Finally, an adaptive edge enhancement module is used to strengthen defect edges, and a multi-branch detection head performs parallel defect category determination, location regression, and confidence assessment. This invention effectively improves the detection accuracy and robustness of tower defects in complex backgrounds, and is particularly suitable for the automatic identification of small-scale defects.

[0079] Beneficial effects:

[0080] 1. Significantly improves detection accuracy and robustness: By integrating multi-scale feature extraction, channel attention mechanism and adaptive contrast enhancement, it effectively overcomes interference from complex backgrounds, enhances the salience of defect areas, and greatly improves the accuracy of defect identification.

[0081] 2. Excellent multi-scale defect detection capability: Adopting a hierarchical feature fusion architecture and adaptive anchor box mechanism, it can simultaneously and accurately detect defects of different sizes from small to large, solving the problem of high false negative rate for small defects in traditional methods.

[0082] 3. Enhanced edge features and long-range dependency modeling: The introduction of the Adaptive Edge Enhancement Module (A2E) and the Selective State Space Module (SS2D) significantly improves the clarity and recognition accuracy of defect boundaries and can effectively capture long-range contextual dependencies in images.

[0083] 4. Optimize computational efficiency and resource allocation: Through technologies such as the Pyramid Distributed Attention (PDA) module, the allocation of computational resources has been optimized, improving the running efficiency of the model while ensuring high performance. Attached Figure Description

[0084] Figure 1 This is a schematic diagram of a method for automatic identification and classification of defects in power distribution network towers based on deep learning, provided as an embodiment of this application.

[0085] Figure 2 This is a schematic diagram of a multi-scale feature extraction and attention enhancement process provided in an embodiment of this application.

[0086] Figure 3 The system architecture diagram of the automatic identification and classification system for power distribution network tower defects based on deep learning provided for this application.

[0087] Figure 4 A schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0088] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them.

[0089] It should be noted that in the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the specification of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.

[0090] It should be noted that in the embodiments of this application, the terms "first," "second," etc., are used only for descriptive purposes and should not be construed as indicating or implying relative importance, nor as indicating or implying order. Features defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of the embodiments of this application, terms such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiments or designs described as exemplary or for example in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present related concepts in a specific manner.

[0091] Based on the embodiments described in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0092] Example 1

[0093] Figure 1 This is a schematic flowchart illustrating a deep learning-based automatic identification and classification method for defects in power distribution network towers, provided as an embodiment of this application. Figure 1 As shown, a method for automatic identification and classification of defects in power distribution network towers based on deep learning includes:

[0094] Step S1: Preprocess the input power distribution network tower image using a convolutional neural network to locate the main tower area and extract its minimum bounding box to eliminate background interference. Preprocessing the input image using a convolutional neural network automatically locates the main tower area and extracts its minimum bounding box, effectively eliminating background interference and providing accurate target areas for subsequent defect identification.

[0095] Specifically, in this embodiment, the tower area positioning and extraction in step S1 specifically includes:

[0096] A lightweight convolutional neural network is used as the backbone network to extract features from the input power distribution network tower images and generate multi-scale feature maps. A lightweight convolutional neural network (CNN) is used as the backbone network to efficiently extract features from the input raw tower images and generate multi-scale feature maps containing semantic information at different levels, providing a rich feature foundation for subsequent regional localization.

[0097] On the feature map, the anchor box mechanism is used to predict candidate bounding boxes for the tower area, and the non-maximum suppression algorithm is used to remove redundant boxes. On the generated feature map, the anchor box mechanism is used to predict multiple candidate bounding boxes for the tower area, and the non-maximum suppression (NMS) algorithm is used to filter out highly overlapping redundant boxes, retaining the candidate area most likely to contain the tower, thereby improving the localization efficiency.

[0098] Coordinate regression optimization is performed on the retained candidate bounding boxes to accurately fit the main body area of ​​the tower. Coordinate regression optimization is also performed on the candidate bounding boxes retained after NMS screening to fine-tune the position and size of the boxes so that they more accurately fit the actual outer contour of the tower body and improve the accuracy of region extraction.

[0099] Based on the optimized bounding box coordinates, the corresponding tower area images are cropped and extracted from the original image, and then uniformly scaled to a preset size for subsequent processing. Based on the optimized precise bounding box coordinates, the corresponding tower areas are cropped from the original image, and all cropped images are uniformly scaled to a preset size to achieve data standardization, preparing for consistent image processing and analysis later.

[0100] The above steps, through a process of feature extraction, candidate prediction, coordinate optimization, and cropping standardization, achieve efficient and accurate extraction of the main body area of ​​the tower, providing a clean and standardized input for subsequent defect identification and reducing background interference from the source.

[0101] Step S2: Apply a contrast enhancement algorithm based on local statistical characteristics to the tower area. By calculating the gray-level distribution characteristics of local image regions, the pixel contrast is adaptively adjusted to enhance the visual salience of the defect area while suppressing background noise. Adaptively adjusting the contrast of the tower area image based on local statistical characteristics enhances the visual salience of the defect area, suppresses image noise, and improves the separability of defect features.

[0102] Specifically, in this embodiment, the local image enhancement in step S2 includes:

[0103] S2.1: Convert the extracted tower area image to the HSV color space, separate the luminance component (V) for enhancement, and preserve chroma and saturation information. The extracted tower area image is converted from the RGB color space to the HSV color space, and the luminance component (V) is separated. This step aims to decouple luminance information from color information so that the luminance component, which determines the image's contrast, can be enhanced independently while preserving the original chroma (H) and saturation (S) information.

[0104] S2.2: Divide the luminance component into several local sub-blocks and calculate the local mean and standard deviation of pixels within each sub-block. This step aims to quantify the average brightness level (mean) and contrast strength / pixel value fluctuation (standard deviation) of different regions of the image, providing a basis for subsequent adaptive pixel-level adjustments.

[0105] S2.3: Based on the aforementioned local statistical characteristics, an adaptive gain function is used to dynamically adjust the contrast of each pixel. The gain coefficient is positively correlated with the local standard deviation and negatively correlated with the local mean. Based on the statistical characteristics (mean and standard deviation) of the local region where each pixel is located, the adaptive gain function dynamically adjusts the contrast of that pixel. The gain coefficient is positively correlated with the local standard deviation (i.e., the weaker the contrast, the greater the enhancement), and negatively correlated with the local mean (i.e., the darker the region, the more gain it receives), thereby achieving an adaptive effect of "higher contrast in low-key areas and brighter contrast in dark areas," significantly enhancing the visual salience of defective areas.

[0106] Specifically, in this embodiment, the calculation of the adaptive gain function in step S2.3 further incorporates global contrast optimization based on the ACE (Adaptive Contrast Enhancement) algorithm, specifically including:

[0107] a) After completing the contrast adjustment based on local statistical characteristics, the enhanced luminance component... Further calculation of each pixel Global contrast response value :

[0108] , ,

[0109] in, For pixels in the ACE algorithm The original global contrast response value is obtained by weighted summation of pixel differences within the neighborhood. The value represents the luminance component after adjustment by the adaptive gain function in step S2.3 (the result after local contrast enhancement), where Ω represents the image domain. This is a slope function used to enhance local differences. and Each pixel and brightness value, The Euclidean distance between two pixels. Represents pixels The local neighborhood is usually a region consisting of... The central window area.

[0110] After completing the contrast adjustment based on local statistics, the global contrast response value of each pixel is further calculated. This step considers the difference between the pixel and other pixels in its larger neighborhood (enhanced by the slope function) and performs a weighted summation with the inverse of the distance as the weight. The aim is to quantify the contrast degree between the pixel and its surrounding environment from a global perspective, making up for the wide-area contextual information that local enhancement may ignore.

[0111] b) Normalize to the interval [0,1]:

[0112] ,

[0113] in, The global contrast response value calculated using the ACE algorithm (Adaptive Contrast Enhancement) is normalized to the interval [0,1]. and Each of the following is a separate section of the entire image. The minimum and maximum values ​​are calculated; the calculated original global contrast response values ​​are normalized to the [0,1] interval through global response value normalization. This step unifies the response values ​​of different pixels to the same numerical range, eliminates the influence of absolute numerical magnitude, and provides a standardized and comparable data basis for subsequent fusion operations.

[0114] c) Further adjust image contrast by optimizing the objective function:

[0115] ,

[0116] in, The weight function is typically the reciprocal of the distance, i.e. M is the normalization factor. Global contrast optimization further adjusts the overall contrast distribution of an image by optimizing an objective function. This objective function balances two goals: "adjusting the overall brightness of the image towards the center" and "enhancing the differences between pixels." It aims to avoid over-enhancing, which could lead to noise amplification or loss of detail, and achieve a more natural and balanced global contrast optimization.

[0117] d) Enhanced The enhanced luminance component is obtained by weighted fusion with the luminance value adjusted by the adaptive gain function in step S2.3. :

[0118] ,

[0119] in, This represents the final enhanced luminance component value. The fusion weight coefficient ranges from 0.5 to 0.7; by fusing the local and global enhancement results, the local contrast enhancement result obtained in step S2.3 is ( ) and the normalized global contrast response obtained in step b ( The process involves weighted fusion. This step combines the advantages of local enhancement (highlighting details) and global optimization (overall balance). By balancing the contributions of both through a weighting coefficient α, the final optimized brightness component is obtained, aiming to simultaneously preserve significant local defect features and good global visual effects.

[0120] e) will The luminance component is merged with the original chroma and saturation components and converted back to the RGB color space. Through image reconstruction, the final optimized luminance component is merged back with the original color information (chroma and saturation) and converted back to the RGB color space for output. This step produces the final enhanced image, which highlights defect details while maintaining natural colors and a good overall look.

[0121] S2.4: The enhanced luminance component is merged with the original chroma and saturation components, and converted back to the RGB color space, outputting the enhanced tower area image. The adaptively enhanced luminance component (V') is then merged again with the original, unchanged chroma (H) and saturation (S) components, and the image is converted from the HSV color space back to the RGB color space. This step ultimately outputs a tower area image that retains natural colors but significantly enhances the contrast of defects.

[0122] By converting the color space, calculating local statistics, and dynamically adjusting pixel contrast based on local characteristics, the image is finally reconstructed. Without introducing color distortion, the contrast between the defect area and the background is effectively enhanced, noise is suppressed, and a higher quality and more easily identifiable input image is provided for subsequent defect detection.

[0123] Step S3: The feature maps are grouped using the pyramid distributed attention module, multi-scale spatial information is fused with channel attention weights, and a channel attention mechanism is introduced into the feature extraction network to enhance attention to defective regions and optimize computational resource allocation. The pyramid distributed attention module is used to group and fuse feature maps at multiple scales, combined with a channel attention mechanism to optimize feature representation, enhance attention to defective regions, and improve computational resource utilization efficiency.

[0124] Figure 2 This is a schematic diagram illustrating a multi-scale feature extraction and attention enhancement process provided in an embodiment of this application. Specifically, as shown... Figure 2 As shown, in this embodiment, the multi-scale feature extraction and attention enhancement in step S3 specifically include:

[0125] S3.1: Extract multi-level feature maps from the main pole area image using a backbone network. A backbone network (such as a CNN) is used to extract feature maps of different abstraction levels and resolutions from the preprocessed main pole area image. These feature maps collectively form a multi-scale feature pyramid, providing a comprehensive feature representation encompassing everything from detailed texture to semantic information for subsequent processing.

[0126] S3.2: Divide the feature map into S groups along the channel dimension; divide the extracted multi-level feature map into S groups along the channel dimension. This step aims to decompose the complex feature channels into multiple subsets for parallel processing, preparing for subsequent implementation of differentiated multi-scale convolution and attention calculations on different groups, and is an optimized allocation strategy for computing resources.

[0127] S3.3: Perform convolution operations at different scales on each group of features to extract multi-scale spatial features; for each group of features after partitioning, perform convolution operations using convolution kernels of different scales. This step aims to explicitly extract defect feature patterns at different spatial scales (such as large-area corrosion and fine cracks), enhancing the model's ability to perceive and represent multi-scale defects.

[0128] S3.4: Apply the squeeze-excited (SE) attention module to each feature group to generate channel attention weight vectors for each group; apply a squeeze-excited (SE) attention module to each feature group after multi-scale convolution. This module generates a channel attention weight vector for each feature group by modeling the interdependencies between channels, which identifies which feature channels within the group are more important for defect identification.

[0129] Specifically, the process of generating channel attention weight vectors by the squeeze excitation (SE) attention module in step S3.4 includes:

[0130] S3.4.1: For each set of feature maps Perform global average pooling to compress the spatial dimension and generate channel-level global descriptors. The calculation formula is as follows:

[0131] ,

[0132] in: Indicates the feature map at location The value at; H represents the number of channels, and H and W represent the height and width of the feature map, respectively. The result of global average pooling on the c-th channel is a scalar value representing the average activation intensity of that channel across all spatial locations, i.e., the global importance of that channel. Global average pooling (GAP) is performed on each feature map, compressing the two-dimensional feature map (HxW) of each channel into a single scalar value. This operation aggregates the global information of each channel across all spatial locations, generating a channel-level global descriptor vector to characterize the global average activation intensity (i.e., global importance) of each channel.

[0133] S3.4.2: Set the global descriptor The input consists of two fully connected layers with a bottleneck structure. The first fully connected layer reduces the dimension to [value missing]. Where r is the reduction ratio, and the ReLU activation function is used to introduce non-linearity; then the dimension is restored to through a second fully connected layer. Channel attention weights are generated using the Sigmoid activation function. The calculation formula is as follows:

[0134] ,

[0135] in, and These are the weight parameters of the fully connected layer. and The first fully connected layer (dimensionality reduction layer) contains the weight matrices, where δ represents the ReLU activation function and σ represents the Sigmoid activation function. The generated global descriptor vector is input into a bottleneck structure consisting of two fully connected layers. First, the first fully connected layer (dimensionality reduction layer) reduces the number of parameters and introduces non-linearity (ReLU). Then, the second fully connected layer (restore layer) restores the dimensionality to the original number of channels, and the Sigmoid function generates a channel attention weight vector between 0 and 1. Each value in this weight vector represents the importance of the corresponding channel.

[0136] S3.4.3: Generate channel attention weights The channel attention weight vectors calculated in step S3.4.2 are formally determined as the attention weight vectors corresponding to this set of feature maps. This step clarifies the assignment and purpose of the vector, preparing for subsequent feature reweighting.

[0137] S3.4.4: The weight vector is fused with the original feature map through channel-by-channel multiplication to obtain the enhanced feature map. The generated channel attention weight vector is then multiplied with the original feature map of the same set through channel-by-channel multiplication. This operation adaptively recalibrates the feature response based on the importance weight of each channel: amplifying the feature values ​​of important channels and suppressing the feature values ​​of unimportant channels. The final output is the feature map enhanced by the channel attention mechanism.

[0138] In this step, the core mechanism of the SE attention module is "squeeze-encourage-reweight." It obtains a channel-level global description by compressing global spatial information, then learns the non-linear relationships between channels and generates adaptive weights through a simple gating mechanism (two fully connected layers). Finally, it adaptively enhances useful feature channels and suppresses useless feature channels through reweighting. This module effectively improves the model's ability to perceive defective feature channels, making the network pay more attention to information-rich features.

[0139] S3.5: The Softmax function is used to normalize the channel attention weight vectors generated by each group, resulting in recalibrated multi-scale channel weights; the Softmax function is also used to perform cross-group normalization on the channel attention weight vectors generated by all S groups. This step integrates the independent attention weights of each group into a unified probability distribution framework, achieving cross-scale and cross-group weight recalibration, thereby evaluating and comparing the importance of different groups and different channels globally.

[0140] Specifically, step S3.5, which uses the Softmax function to normalize the attention weight vectors of each group to obtain the recalibrated multi-scale channel weights, includes the following steps:

[0141] S3.5.1: Transfer the channel attention weights corresponding to the feature maps of group S to... The vectors are concatenated to form a multi-scale channel attention weight vector. The calculation formula is as follows:

[0142] ,

[0143] Where ⊕ represents the vector concatenation operation, The total number of channels is given. The channel attention weight vectors generated independently from the S groups (corresponding to S different scales) are concatenated to form a comprehensive multi-scale channel attention weight vector. This step aims to aggregate channel importance information across all scales into a unified data structure, laying the foundation for subsequent cross-scale global importance comparison and recalibration.

[0144] S3.5.2: For the concatenated weight vector By applying the Softmax function and mapping it to a probability distribution, the recalibrated multi-scale channel weights are obtained. The calculation formula is as follows:

[0145] , ,

[0146] in, Indicates the first Normalized channel attention weights corresponding to the group feature maps Indicates the first The channel attention weight vectors generated after the group feature maps pass through their respective SE attention modules The total number of groups. The Softmax function is applied to the concatenated composite weight vector to transform it into a probability distribution where the sum of all elements is 1. The core function of this step is to achieve cross-group, global weight recalibration. Through the competition mechanism of the Softmax function, it allows the weights of all groups and all channels to be compared and redistributed globally, thereby quantifying the global importance of each channel relative to all other channels, and ultimately generating the recalibrated multi-scale channel weights.

[0147] This step provides a global attention weight integration and recalibration mechanism. It transcends the limitation of a single SE module evaluating channel importance only within its group, achieving global competition and redistribution of channel importance across all scales (all groups) through concatenation and Softmax normalization. This ensures that the final weights used for feature weighting are calculated in the global context of all available information (multi-scale features), thus more accurately and consistently guiding the model to focus on the most relevant features across scales and optimizing the multi-scale feature fusion effect.

[0148] S3.6: Perform channel-by-channel multiplication on the recalibrated weights and the corresponding multi-scale feature maps to enhance the feature responses related to defects; perform channel-by-channel multiplication on the recalibrated, normalized multi-scale channel weights and the corresponding original multi-scale feature maps. This operation amplifies the responses of key feature channels and suppresses unimportant or redundant feature channels according to the importance of the weights, thereby adaptively enhancing the multi-scale features most relevant to defects.

[0149] S3.7: Concatenate multiple weighted feature maps along the channel dimension to output an enhanced multi-scale feature representation. The S sets of feature maps, enhanced by attention weights, are then re-concatenated and fused along the channel dimension to form the final enhanced multi-scale feature representation. The output of this step integrates feature information from different scales, optimized by the attention mechanism, providing a more powerful and focused feature input for subsequent defect classification and localization tasks.

[0150] Step S4: A two-dimensional selective state space module is introduced to model the feature sequence and capture long-range dependencies. Simultaneously, a hierarchical feature fusion architecture is introduced into the detection network. This aggregates feature maps of different resolutions through cross-level upsampling and downsampling paths, and employs an adaptive anchor box mechanism to match defect targets of different sizes, improving the detection capability for micro-scale defects. The two-dimensional selective state space module captures long-range spatial dependencies in the feature sequence, and the hierarchical feature fusion architecture aggregates features of different resolutions. Combined with the adaptive anchor box mechanism, this enhances the detection capability for multi-scale (especially micro-scale) defects.

[0151] Specifically, in this embodiment, step S4 includes the following sub-steps:

[0152] S4.1: A two-dimensional selective state-space module (SS2D) is introduced to model long-range dependencies of the feature sequences extracted by the backbone network; the SS2D module selectively scans the context information in the image space through learnable parameters, and its state-space representation is defined by the following formula:

[0153] , ,

[0154] in, This indicates the hidden state at the current moment. For input features, , , A learnable parameter matrix is ​​used to control state evolution, input projection, and output generation. A two-dimensional selective state space module (SS2D) is introduced to model the feature sequences extracted by the backbone network. This module uses learnable parameters (matrix) to control these parameters. , , Selectively scanning the contextual information in the image space, its state-space representation can effectively capture long-range dependencies between pixels. This step aims to address the limited receptive field of traditional convolution operations, improve the model's ability to understand global contextual information of the image, and is particularly suitable for handling the spatially distant correlations of tower defects.

[0155] S4.2: Construct a hierarchical feature fusion architecture that aggregates feature maps of different resolutions through cross-level upsampling and downsampling paths. Specifically, deep semantic features are added element-wise with shallow high-resolution features through bilinear upsampling, and 1×1 convolutions are used for channel dimension alignment and fusion. This step aims to combine the advantages of deep and shallow features to generate fused features that simultaneously contain rich semantic and precise localization information, providing support for detecting defects at different scales.

[0156] S4.3: An adaptive anchor box mechanism is used to dynamically match defect targets of different sizes. For each feature map layer, based on its receptive field size and resolution, the width and height of the ground truth bounding boxes in the training set are clustered using the K-means clustering algorithm to generate prior anchor box sizes. The weights of the anchor box sizes are dynamically adjusted based on the Intersection over Union (IoU) between the predicted and ground truth boxes. This adaptive anchor box mechanism dynamically matches defect targets of different sizes. For feature maps at different network layers (with different receptive fields and resolutions), the width and height of the ground truth bounding boxes in the training set are clustered using the K-means clustering algorithm to automatically generate the best-matching prior anchor box sizes. The weights of the anchor box sizes are dynamically adjusted based on the IoU between the predicted and ground truth boxes. This step replaces the tedious manual setting of anchor boxes, making the anchor box sizes more consistent with the actual data distribution, and significantly improving the recall rate and localization accuracy for multi-scale targets (especially small defects).

[0157] S4.4: The feature map enhanced by the SS2D module is input into the hierarchical fusion architecture, outputting a feature representation with rich multi-scale contextual information for subsequent defect classification and localization. The feature map enhanced by the SS2D module, possessing strong long-range contextual information, is input into the aforementioned hierarchical fusion architecture for multi-scale feature aggregation. The final output is a feature representation that integrates global context, multi-level semantics, and spatial details. The function of this step is to provide high-quality, information-rich feature input for the final detection head, directly improving the accuracy of subsequent defect classification and localization.

[0158] Step S5: Enhance defect edge features using an adaptive edge enhancement module to improve boundary recognition accuracy; process the enhanced image using a detection head with a multi-branch prediction structure, and output prediction results on feature maps of different scales in parallel to achieve defect category determination, location regression, and confidence assessment, thus completing the automatic identification and classification of various tower defects. The adaptive edge enhancement module enhances defect boundary features to improve edge recognition accuracy; parallel prediction is achieved through a multi-branch detection head, ultimately completing defect category determination, location regression, and confidence assessment, achieving end-to-end automatic identification and classification.

[0159] Specifically, in this embodiment, step S5 includes the following sub-steps:

[0160] S5.1: Enhance defect edge features through an adaptive edge enhancement module (A2E); the A2E module employs a learnable edge-aware convolutional kernel, and its core operation is represented as follows:

[0161] ,

[0162] in, For the enhanced feature map, For the input feature map, For convolutional kernel weights that are adapted based on local image content, The kernel size is specified; an Adaptive Edge Enhancement (A2E) module is used to perform convolution operations on the input feature map using a learnable kernel with weights adapted based on local image content. This module can enhance the edge features at the boundary between defects and the background, improving the clarity and saliency of the defect contour, thereby effectively improving the accuracy of subsequent bounding box regression, especially suitable for defects with blurred edges or low contrast.

[0163] S5.2: Construct a detection head with a multi-branch prediction structure, containing three parallel branches: Category Prediction Branch: Outputs the defect category probability distribution for each anchor box through a 1×1 convolution; Bounding Box Regression Branch: Predicts the offset of each anchor box relative to the prior box; Confidence Evaluation Branch: Outputs the confidence level that each predicted box contains a defect target. This step constructs a detection head with three parallel branches, each responsible for a specific task: Category Prediction Branch: Outputs the probability distribution of each anchor box corresponding to various defect types through a 1×1 convolution, achieving defect category determination. Bounding Box Regression Branch: Predicts the fine-grained offset (such as center point offset, width and height scaling) of each anchor box relative to its matching prior anchor box, achieving pixel-level precise defect localization. Confidence Evaluation Branch: Outputs the degree of certainty (confidence level) that each predicted box contains a defect target, used to distinguish between foreground (defect) and background. This step achieves efficient multi-task learning through parallel design.

[0164] S5.3: Parallel prediction is performed on feature maps of different scales. A Feature Pyramid Network (FPN) is used to fuse deep semantic information with shallow detail information, enabling the detection of defects of different sizes. The predictions in S5.2 are performed in parallel on feature maps of different scales provided by the Feature Pyramid Network (FPN). The FPN fuses deep semantic information with shallow detail information, enabling the detection head to detect small targets on high-resolution feature maps and large targets on low-resolution feature maps, thus achieving comprehensive detection of defects of different sizes.

[0165] S5.4: End-to-end optimization is performed using a weighted multi-task loss function, the expression of which is:

[0166] ,

[0167] in, For classifying losses, $ represents the regression loss. For confidence loss, Here are the weight coefficients for each loss; a weighted multi-task loss function is used for end-to-end training and optimization of the entire network. This loss function is a weighted sum of the classification loss, regression loss, and confidence loss, determined by the weight coefficients (…). Balancing the importance of the three sub-tasks ensures that the model simultaneously optimizes classification accuracy, localization precision, and the reliability of confidence assessment.

[0168] S5.5: Redundant bounding boxes are removed using the Non-Maximum Suppression (NMS) post-processing algorithm, outputting the final defect identification and classification results. The NMS post-processing algorithm filters out numerous overlapping bounding boxes generated during the prediction stage, removing redundant boxes and retaining only the bounding boxes with the highest confidence and optimal location as the final output. This step ensures the simplicity and accuracy of the final result, outputting the final defect category, location, and confidence level.

[0169] Adaptive edge enhancement improves feature quality, multi-branch detection heads achieve accurate classification, localization, and evaluation, multi-scale prediction and end-to-end optimization ensure detection performance for various defects, and finally, NMS outputs clean results. These steps collectively guarantee the high accuracy, high recall, and high efficiency of the model's final output.

[0170] This invention constructs a complete deep learning detection process, gradually realizing a functional closed loop from region extraction, feature enhancement, multi-scale modeling to accurate identification, and systematically solving the problem of automated detection and classification of multi-scale defects in power distribution network towers under complex backgrounds.

[0171] Example 2

[0172] like Figure 3As shown in the figure, this application provides an architecture diagram of a deep learning-based automatic identification and classification system for power distribution network tower defects. It is applied to the deep learning-based automatic identification and classification system for power distribution network tower defects as described in Embodiment 1. The system includes a tower main area localization and extraction module 11, a local image enhancement module 12, a multi-scale feature extraction and attention enhancement module 13, a state space modeling and multi-scale feature fusion module 14, and an edge enhancement and defect classification and localization module 15.

[0173] The tower main body area localization and extraction module 11 is used to preprocess the input power distribution network tower image using a convolutional neural network, locate the tower main body area and extract its minimum bounding rectangle to eliminate background interference.

[0174] The local image enhancement module 12 is used to apply a contrast enhancement algorithm based on local statistical characteristics to the main area of ​​the tower. By calculating the gray-scale distribution characteristics of the local area of ​​the image, the pixel contrast is adaptively adjusted to enhance the visual salience of the defect area while suppressing background noise.

[0175] The multi-scale feature extraction and attention enhancement module 13 is used to group the feature maps using the pyramid distributed attention module, integrate multi-scale spatial information and channel attention weights, and introduce a channel attention mechanism into the feature extraction network to enhance attention to defective regions and optimize the allocation of computing resources.

[0176] The state space modeling and multi-scale feature fusion module 14 is used to introduce a two-dimensional selective state space module to model the feature sequence and capture long-range dependencies. At the same time, a hierarchical feature fusion architecture is introduced into the detection network. By aggregating feature maps of different resolutions through cross-level upsampling and downsampling paths, and using an adaptive anchor box mechanism to match defect targets of different sizes, the detection capability of small-scale defects is improved.

[0177] The edge enhancement and defect classification and localization module 15 is used to enhance the edge features of defects through the adaptive edge enhancement module, thereby improving the accuracy of boundary recognition. It also uses a detection head with a multi-branch prediction structure to process the enhanced image and outputs the prediction results on feature maps of different scales in parallel to achieve defect category determination, location regression and confidence assessment, thus completing the automatic identification and classification of various tower defects.

[0178] Figure 4 This is an electronic device provided in one embodiment of this application. For example... Figure 4 As shown, the electronic device includes at least the following components: processor 101 and memory 100, communication interface 103, and bus 102.

[0179] In this embodiment of the application, memory 100 is used to store executable instructions of processor 101, which, when configured to execute instructions, implements the method as described in the first aspect.

[0180] In embodiments of this application, a computer-readable storage medium includes instructions that instruct a device to perform the method as described in the first aspect. For example, the instructions instruct the device to perform... Figure 1 The method is shown in the process steps.

[0181] In one embodiment of this application, the program operating in the electronic device may be a program that controls a central processing unit (CPU) or similar device to achieve the functions of the above-described embodiments of the present invention (a program that enables the computer to function). Information processed by these systems is then temporarily stored in random access memory (RAM) during processing, and subsequently stored in various ROMs such as read-only memory (FlashROM) and hard disk drives (HDDs), and read, corrected, and written by the CPU as needed.

[0182] It should be noted that a portion of the electronic device described in the above embodiments can also be implemented using a computer. In this case, the program for implementing the control function can be recorded on a computer-readable recording medium, and the program recorded on the recording medium can be read into the computer and executed.

[0183] It should be noted that the computer mentioned here refers to a computer built into an electronic device, employing hardware including an operating system and peripheral devices. Furthermore, computer-readable recording media refers to removable media such as floppy disks, magneto-optical disks, ROMs, and CD-ROMs, as well as storage systems such as hard drives built into the computer.

[0184] Furthermore, computer-readable recording media can include: media that dynamically stores programs for short periods of time, such as communication lines used when transmitting programs via networks like the Internet or communication lines like telephone lines; and media that store programs for fixed periods of time, such as volatile memory inside a computer that serves as a server or client in this case. In addition, the aforementioned program can be a program used to implement the above-mentioned functions, or it can be a program that can implement the above-mentioned functions by combining them with programs already recorded in the computer.

[0185] Furthermore, the electronic device in the above embodiments can also be implemented as an assembly (system group) composed of multiple systems. Each system constituting the system group can possess some or all of the functions or functional blocks of the electronic device in the above embodiments. As a system group, it is sufficient to have all the functions or functional blocks of the electronic device.

[0186] Those skilled in the art should recognize that the above embodiments are only used to illustrate this application and are not intended to limit this application. Any appropriate changes and variations made to the above embodiments within the essential spirit and scope of this application fall within the scope of protection claimed in this application.

Claims

1. A deep learning-based power distribution network tower defect automatic identification and classification method, characterized in that, The method includes: Step S1: Use a convolutional neural network to preprocess the input power distribution network tower image, locate the main area of ​​the tower and extract its minimum bounding rectangle to eliminate background interference; Step S2: Apply a contrast enhancement algorithm based on local statistical characteristics to the main area of ​​the tower. By calculating the gray-scale distribution characteristics of the local area of ​​the image, the pixel contrast is adaptively adjusted to enhance the visual salience of the defect area while suppressing background noise. Step S3: Use the pyramid distributed attention module to group the feature maps, fuse multi-scale spatial information and channel attention weights, and introduce a channel attention mechanism into the feature extraction network to enhance attention to defective regions and optimize the allocation of computing resources; Step S4: Introduce a two-dimensional selective state space module to model the feature sequence and capture long-range dependencies; at the same time, introduce a hierarchical feature fusion architecture in the detection network, aggregate feature maps of different resolutions through cross-level upsampling and downsampling paths, and use an adaptive anchor box mechanism to match defect targets of different sizes to improve the detection capability of micro-scale defects. Step S5: Enhance defect edge features through an adaptive edge enhancement module to improve boundary recognition accuracy; and process the enhanced image using a detection head with a multi-branch prediction structure. By outputting prediction results on feature maps of different scales in parallel, the defect category is determined, location is regressed, and confidence is assessed, thus completing the automatic identification and classification of various tower defects. Step S4 specifically includes the following sub-steps: S4.1: A two-dimensional selective state space module is introduced to model the long-range dependencies of the feature sequences extracted by the backbone network. The module selectively scans the context information in the image space through learnable parameters. Its state space representation is jointly defined by the hidden state at the current time, the input features, and the learnable parameter matrix generated by the evolution of the control state, the input projection, and the output. S4.2: Construct a hierarchical feature fusion architecture, which aggregates feature maps of different resolutions through cross-level upsampling and downsampling paths. Specifically, it includes adding deep semantic features to shallow high-resolution features element-wise through bilinear upsampling, and using one-to-one convolution to align and fuse the channel dimensions. S4.3: An adaptive anchor box mechanism is adopted to dynamically match defect targets of different sizes. For each feature map layer, the width and height of the real labeled boxes in the training set are clustered according to the receptive field size and resolution to generate the prior anchor box size. The weight of the anchor box size is dynamically adjusted according to the intersection-union ratio of the predicted box and the real box. S4.4: The feature map enhanced by the two-dimensional selective state space module is input into the hierarchical fusion architecture, and the feature representation with rich multi-scale context information is output for subsequent defect classification and localization.

2. The method for automatic identification and classification of defects in power distribution network towers based on deep learning according to claim 1, characterized in that, The specific steps of locating and extracting the main area of ​​the tower in step S1 include: A lightweight convolutional neural network is used as the backbone network to extract features from the input power distribution network tower images and generate multi-scale feature maps. An anchor box mechanism is used on the feature map to predict candidate bounding boxes for the main body region of the tower, and redundant boxes are removed by a non-maximum suppression algorithm. Coordinate regression optimization is performed on the retained candidate bounding boxes to accurately fit the main area of ​​the tower; Based on the optimized bounding box coordinates, the corresponding tower main body area image is cropped and extracted from the original image, and uniformly scaled to a preset size for subsequent processing.

3. The method for automatic identification and classification of defects in power distribution network towers based on deep learning according to claim 1, characterized in that, The enhancement algorithm in step S2 specifically includes: S2.1: Convert the extracted image of the main tower area to the HSV color space, separate the luminance component V for enhancement processing, and retain chroma and saturation information; S2.2: Divide the luminance component into several local sub-blocks, and calculate the local mean and standard deviation of the pixels in each sub-block; S2.3: Based on the aforementioned local statistical characteristics, the contrast of each pixel is dynamically adjusted using an adaptive gain function, wherein the gain coefficient is positively correlated with the local standard deviation and negatively correlated with the local mean. S2.4: Merge the enhanced luminance component with the original chroma and saturation components, convert them back to the RGB color space, and output the enhanced image of the main tower area.

4. The method for automatic identification and classification of defects in power distribution network towers based on deep learning according to claim 3, characterized in that, The calculation of the adaptive gain function in step S2.3 further incorporates global contrast optimization based on the ACE algorithm, specifically including: a) After completing the contrast adjustment based on local statistical characteristics, the enhanced luminance component... Further calculation of each pixel Global contrast response value ; b) Normalize to the interval [0,1]: , in, This is the global contrast response value calculated using the ACE algorithm. and Each of the entire image The minimum and maximum values; c) Further adjust image contrast by optimizing the objective function: , in, The weighting function is, i.e. M is the normalization factor. , and Each pixel and brightness value, For slope function, Represents pixels The local neighborhood; d) Enhanced The enhanced luminance component is obtained by weighted fusion with the luminance value adjusted by the adaptive gain function in step S2.

3. : , in, This represents the final enhanced luminance component value. For fusion weighting coefficients; e) will It is merged with the original chroma and saturation components and converted back to the RGB color space.

5. The method for automatic identification and classification of defects in power distribution network towers based on deep learning according to claim 1, characterized in that, The multi-scale feature extraction and attention enhancement in step S3 specifically include: S3.1: Extract multi-level feature maps of the main area image of the tower using the backbone network; S3.2: Divide the feature map into S groups along the channel dimension; S3.3: Perform convolution operations at different scales on each set of features to extract multi-scale spatial features; S3.4: Apply the squeeze-excited SE attention module to each group of features to generate the channel attention weight vector for each group; S3.5: Use the Softmax function to normalize the channel attention weight vectors generated in each group to obtain the recalibrated multi-scale channel weights; S3.6: Perform channel-by-channel multiplication on the recalibrated weights and the corresponding multi-scale feature maps to enhance the feature response related to defects; S3.7: Concatenate multiple weighted feature maps along the channel dimension to output an enhanced multi-scale feature representation.

6. The method for automatic identification and classification of defects in power distribution network towers based on deep learning according to claim 5, characterized in that, S3.4: Apply the squeeze-excited SE attention module to each group of features to generate the channel attention weight vector for each group, including: S3.4.1: For each set of feature maps Perform global average pooling to compress the spatial dimension and generate channel-level global descriptors. ; Indicates the number of channels; S3.4.2: Set the global descriptor The input consists of two fully connected layers with a bottleneck structure. The first fully connected layer reduces the dimension to [value missing]. Where r is the reduction ratio, and the ReLU activation function is used; then the dimension is restored to 1 / 2 using a second fully connected layer. Channel attention weights are generated using the Sigmoid activation function. ; S3.4.3: Generate channel attention weights As the attention weight vector of this set of feature maps; S3.4.4: The weight vector is fused with the original feature map through channel-by-channel multiplication to obtain the enhanced feature map.

7. The method for automatic identification and classification of defects in power distribution network towers based on deep learning according to claim 6, characterized in that, S3.5: The channel attention weight vectors generated in each group are normalized using the Softmax function to obtain recalibrated multi-scale channel weights, including: The channel attention weight vectors corresponding to the S groups of feature maps are concatenated to form a multi-scale channel attention weight vector, where the total number of channels after concatenation is S multiplied by the number of original channels in each group. The Softmax function is applied to the concatenated weight vector to map it to a probability distribution, resulting in the recalibrated multi-scale channel weights. The normalized channel attention weights corresponding to the i-th feature map are calculated by the ratio of the exponent of the weight vector of that group to the sum of the exponents of all weight vectors.

8. The method for automatic identification and classification of defects in power distribution network towers based on deep learning according to claim 1, characterized in that, Step S5 specifically includes the following sub-steps: S5.1: Enhance defect edge features through an adaptive edge enhancement module, which uses a learnable convolutional kernel based on local image content adaptation for edge feature enhancement; S5.2: Construct a detection head with a multi-branch prediction structure, which includes three parallel branches: the category prediction branch outputs the defect category probability distribution of each anchor box through a one-to-one convolution; the bounding box regression branch predicts the offset of each anchor box relative to the prior box; and the confidence evaluation branch outputs the confidence that each predicted box contains a defect target. S5.3: Perform predictions in parallel on feature maps of different scales, and fuse deep semantic information with shallow detail information through a feature pyramid network to achieve the detection of defects of different sizes; S5.4: End-to-end optimization is performed using a weighted multi-task loss function, which consists of three parts: classification loss, regression loss, and confidence loss. The contribution of each loss term is balanced by weighting coefficients. S5.5: Redundant detection boxes are removed by a nonmaximum suppression post-processing algorithm, and the final defect identification and classification results are output.

9. A deep learning-based automatic identification and classification system for power distribution network tower defects, applied to the deep learning-based automatic identification and classification method for power distribution network tower defects as described in any one of claims 1 to 8, characterized in that, The system includes: The tower main body area localization and extraction module is used to preprocess the input power distribution network tower image using a convolutional neural network, locate the tower main body area and extract its minimum bounding rectangle to eliminate background interference; The local image enhancement module is used to apply a contrast enhancement algorithm based on local statistical characteristics to the main area of ​​the tower. By calculating the gray-level distribution characteristics of the local area of ​​the image, the pixel contrast is adaptively adjusted to enhance the visual salience of the defect area while suppressing background noise. The multi-scale feature extraction and attention enhancement module is used to group feature maps using the pyramid distributed attention module, integrate multi-scale spatial information and channel attention weights, and introduce a channel attention mechanism into the feature extraction network to enhance attention to defective regions and optimize the allocation of computing resources. The state space modeling and multi-scale feature fusion module is used to introduce a two-dimensional selective state space module to model feature sequences and capture long-range dependencies. At the same time, a hierarchical feature fusion architecture is introduced into the detection network, which aggregates feature maps of different resolutions through cross-level upsampling and downsampling paths, and adopts an adaptive anchor box mechanism to match defect targets of different sizes, thereby improving the detection capability of micro-scale defects. The edge enhancement and defect classification and localization module is used to strengthen defect edge features through an adaptive edge enhancement module, thereby improving boundary recognition accuracy. A detection head with a multi-branch prediction structure processes the enhanced image, and by outputting prediction results on feature maps of different scales in parallel, it achieves defect category determination, location regression, and confidence assessment, completing the automatic identification and classification of various tower defects. The state space modeling and multi-scale feature fusion specifically include the following sub-steps: S4.1: A two-dimensional selective state space module is introduced to model the long-range dependencies of the feature sequences extracted by the backbone network. The module selectively scans the context information in the image space through learnable parameters. Its state space representation is jointly defined by the hidden state at the current time, the input features, and the learnable parameter matrix generated by the evolution of the control state, the input projection, and the output. S4.2: Construct a hierarchical feature fusion architecture, which aggregates feature maps of different resolutions through cross-level upsampling and downsampling paths. Specifically, it includes adding deep semantic features to shallow high-resolution features element-wise through bilinear upsampling, and using one-to-one convolution to align and fuse the channel dimensions. S4.3: An adaptive anchor box mechanism is adopted to dynamically match defect targets of different sizes. For each feature map layer, the width and height of the real labeled boxes in the training set are clustered according to the receptive field size and resolution to generate the prior anchor box size. The weight of the anchor box size is dynamically adjusted according to the intersection-union ratio of the predicted box and the real box. S4.4: The feature map enhanced by the two-dimensional selective state space module is input into the hierarchical fusion architecture, and the feature representation with rich multi-scale context information is output for subsequent defect classification and localization.

Citation Information

Patent Citations

  • Power station equipment defect identification method and related equipment

    CN117173148A

  • Surface defect detection method based on YOLOX multi-scale network reconstruction

    CN120031828A