Lightweight semantic segmentation network and method for power grid inspection

By adopting a lightweight semantic segmentation network with an encoder-decoder architecture in power grid patrol, and using technologies such as MobileNet v2 and hollow space pyramid pooling module, the problem that existing algorithms are difficult to segment narrow and long targets in complex scenarios is solved, achieving efficient and accurate grid patrol segmentation effect.

CN119600602AActive Publication Date: 2025-03-11SOUTHWEST JIAOTONG UNIV

Patent Information

Application Number
CN202411633201.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-03-11
Estimated Expiration
2044-11-15

AI Technical Summary

Technical Problem

The existing semantic segmentation algorithms are difficult to accurately segment narrow and long targets and multi-scale targets when dealing with complex power grid patrol scenarios, and the calculation complexity is high, making it difficult to achieve efficient deployment on resource-constrained drones.

Method used

A lightweight semantic segmentation network with an encoder-decoder architecture is adopted, and feature extraction is performed using the MobileNet v2 backbone network, and a lightweight large-scale hollow space pyramid pooling module and a cross-attention wavelet fusion module are introduced. Combined with a full-dimensional dynamic convolution post-processing module, the modeling ability and multi-scale processing ability of the model to narrow and long targets are improved.

Benefits of technology

It significantly improves the segmentation accuracy and efficiency of the model in power grid inspection tasks, reduces the computational complexity, and enables the model to be efficiently deployed on resource-constrained drone equipment, reducing false detection and missed detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0005136472710000023
    Figure BDA0005136472710000023
  • Figure BDA0005136472710000025
    Figure BDA0005136472710000025
  • Figure BDA0005136472710000034
    Figure BDA0005136472710000034
Patent Text Reader

Abstract

The invention discloses a lightweight semantic segmentation network and method for power grid inspection, and the method comprises the steps: employing an encoder-decoder architecture, inputting original data into a lightweight MobileNet v2 backbone network for feature extraction at an encoder part, inputting an obtained feature map into a lightweight large-scale ASPP module, and carrying out the feature extraction; further performing multi-scale feature extraction on the high-dimensional feature map; and in the decoder part, high-dimensional features and low-dimensional features obtained by the backbone network are respectively input into a cross attention wavelet fusion module, after an obtained feature map is fused with the output of a decoder, the feature map is recovered to the size of original data through down-sampling operation by a full-dimensional dynamic convolution post-processing module, and a final prediction mask is obtained. According to the invention, by optimizing a coding and decoding structure, the receptive field of the model and the modeling capability of a narrow and long target are improved, the balance between the precision and the complexity can be effectively realized, and the method is suitable for an unmanned aerial vehicle inspection system with limited resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to power grid inspection technology, and in particular to a lightweight semantic segmentation network and method for power grid inspection. Background Art

[0002] The power system is the core of modern social infrastructure, and its safety and stability directly affect the development of the national economy and society. However, with the continuous expansion of the scale of the power grid, the traditional manual inspection method has been unable to cope with the complex and changing environment of the power grid. Manual inspection is not only time-consuming and inefficient, but also has a high risk of missed inspections and false inspections. For this reason, automated inspections based on drones have gradually become the mainstream trend of power grid inspections. Drones combined with deep learning algorithms can improve inspection efficiency and reduce labor costs, especially in the detection of key equipment such as power lines, transmission towers and insulators, showing significant advantages.

[0003] The deep learning methods used in power grid inspection are mainly semantic segmentation and target detection. The target detection algorithm puts a bounding box on each target and cannot accurately restore the target's outline. Therefore, its application in power grid inspection scenarios where the target boundary needs to be accurately located is limited. Compared with the target detection algorithm, the more advanced semantic segmentation algorithm divides the boundary of the target object in detail by assigning a category label to each pixel, which helps to find and locate some difficult-to-detect defects. Therefore, for power grid inspection scenarios that are sensitive to boundary details, semantic segmentation shows its unique advantages over target detection. However, existing semantic segmentation algorithms also have obvious limitations when dealing with complex inspection scenarios. Targets such as power lines occupy very few pixels in aerial images, and traditional semantic segmentation algorithms are difficult to accurately restore the boundaries of narrow and long targets. In addition, complex background information further increases the difficulty of detection, resulting in missed detection or false detection. In terms of computational complexity, many high-precision algorithms have large parameters and high computational overhead, making it difficult to achieve efficient deployment on resource-constrained drones, which seriously limits their application in actual inspection tasks.

[0004] At present, semantic segmentation methods applied to power grid inspection are mainly divided into two categories. The first category is based on the encoder-decoder network structure, such as U-Net and SegNet. Zhai Xueming et al. from North China Electric Power University replaced the convolution of U-Net with a deep separable convolution, introduced a channel attention module, and improved the detection effect of power line defects; State Grid Zhejiang Electric Power Co., Ltd. introduced residual and asymmetric convolutions, reduced the network depth, and optimized the application of SegNet in power line defect detection; The second method is based on the network structure of the dilated convolution layer. Chen et al. introduced a decoder structure based on DeepLab v3 to restore image resolution, and captured multi-scale context information through the dilated space pyramid pooling ASPP module. Li Jiaxin et al. from the School of Information Engineering of Nanchang Hangkong University introduced deep separable convolution to improve the structure of dilated space pyramid pooling ASPP, combined with residual network to alleviate the gradient vanishing problem of DeepLab v3+, and improved the segmentation accuracy of the power drainage wire clamp screw; Li Shengli et al. from North China Electric Power University added dilated convolutions with different dilated rates on the basis of FCN structure, and used conditional random fields to improve the segmentation accuracy of transmission lines. The current improvements to DeepLab v3+ have improved the segmentation effect of target boundaries to a certain extent, but its ASPP module has limited modeling capabilities for narrow and long targets, and the loss of feature details during upsampling still exists. In addition, the complex structure and high computational complexity of DeepLab v3+ make it difficult to effectively deploy in resource-constrained devices such as drones. With the expansion of the scale of power systems and the increasing demand for power grid inspections, developing a semantic segmentation model that can accurately segment various types of targets in the power grid, especially narrow and long targets, while taking into account the characteristics of high efficiency and lightweight has become an urgent problem that needs to be solved in the current power grid inspection field. Summary of the invention

[0005] In order to solve the problem that numerous narrow and long targets and multi-scale targets are difficult to segment accurately in complex inspection scenarios, the present invention provides a lightweight semantic segmentation network and method for power grid inspection.

[0006] The invention discloses a lightweight semantic segmentation network for power grid inspection, which adopts an encoder-decoder architecture. In the encoder part, the original data is input into a lightweight MobileNet v2 backbone network for feature extraction, and the obtained feature map is input into a lightweight large-scale void space pyramid pooling ASPP module, and multi-scale feature extraction is further performed on the high-dimensional feature map. This module includes a series of 1×1 convolutional layers, three groups of grouped mixed convolutional layers with different expansion rates, and a group of cross-shaped attention pooling layers; in the decoder part, the high-dimensional features and low-dimensional features obtained by the backbone network are respectively input into a cross-attention wavelet fusion module, the spatial dimension and the channel dimension are subjected to attention modeling, and the two parts of information are subjected to feature fusion. After the obtained feature map is fused with the output of the decoder, it is restored to the original data size through a downsampling operation through a full-dimensional dynamic convolution post-processing module to obtain a final prediction mask.

[0007] Furthermore, the grouped mixed convolution layer performs grouped mixed convolution as follows:

[0008] Assume that the number of input channels is M and the number of output channels is N.

[0009] (1) 5×5 grouped convolution: The input feature map is divided into M groups, and a layer-by-layer convolution of size 5×5×1 is used for each channel.

[0010] (2) 3×3 layer-by-layer atrous convolution: After the grouped convolution, 3×3×1 layer-by-layer atrous convolution is performed in parallel on each channel.

[0011] (3) Point-wise convolution: Concatenate the feature maps of all channels in the channel dimension, apply 1×1×N point-wise convolution to aggregate information from different channels, and adjust the number of channels.

[0012] Furthermore, the specific process of the cross-shaped attention pooling layer is:

[0013] Given a two-dimensional tensor Use two mutually perpendicular strip pooling cores to perform pooling operations along the horizontal or vertical spatial dimension, and the horizontal SP output for:

[0014]

[0015] Vertical SP output for:

[0016]

[0017] The horizontal and vertical strip pooling kernels capture the global features of rows and columns respectively, with sizes of H×1 and W×1. After one-dimensional convolution and expend operations, they are summed up and the feature map size is restored to H×W. After expansion and fusion, the generated tensor has the attention to narrow and long targets in both horizontal and vertical directions, and the feature weights are redistributed by dot multiplication with the original feature map.

[0018] Furthermore, the cross-attention wavelet fusion module selects high-frequency components in different directions to construct a new feature map by using discrete wavelet transform, and concatenates it with the original low-frequency component; the high-level feature map extracts channel information through an efficient channel attention mechanism to enhance the high-dimensional feature expression. After global average pooling without dimensionality reduction, it becomes For convolution operation, the size is further adjusted to After an adaptive one-dimensional convolution with a kernel size of k, there is a nonlinear mapping ψ between k and the channel dimension C:

[0019]

[0020] In the formula, τ odd represents the odd number closest to τ, γ and b are linear parameter terms, which are set to 2 and 1 respectively.

[0021] The low-dimensional features after the above operation are point-multiplied with the ECA weights of the high-dimensional features, and then concatenated with the original high-dimensional features in the channel dimension. The number of channels is adjusted through 1×1 convolution, and the final output is obtained after upsampling.

[0022] Furthermore, the dynamic convolution post-processing module introduces a learnable dynamic convolution module in a branch, which dynamically adjusts the spatial dimension, channel dimension, shape and size of the convolution kernel according to the characteristics of the input data to adapt to different input data. Its mathematical expression is:

[0023]

[0024] in represents the attention scalar of the convolution kernel, Represents three newly introduced attention scalars, which are calculated along the input channel dimension and output channel dimension of the convolution kernel Wi kernel space respectively.

[0025] In the other branch, the spatial attention mechanism weighted by global feature information is used. The global maximum pooling and global average pooling are used to aggregate the information of the feature map, and then the features are aggregated using 3×3 convolution to obtain the spatial feature weight of the branch. The weight is then multiplied by the corresponding pixel of the input feature map to obtain the output result. The output of the module is the result of the opposite addition of the feature maps of the two branches, and then the channel information is adjusted through 1×1 convolution.

[0026] A semantic segmentation method of a lightweight semantic segmentation network for power grid inspection of the present invention comprises the following steps:

[0027] Step 1: Build a semantic segmentation dataset for power grid inspection scenarios. This dataset focuses on the common narrow and long features and various backgrounds in the power system. The dataset comes from open source aerial photography data and high-resolution images collected by power grid companies during actual inspections, and contains a total of 1,426 images. The target objects are divided into categories such as transmission lines, wooden transmission poles, and reinforced concrete poles, and pixel-level segmentation masks are manually annotated.

[0028] Step 2: Initialize the weights of the backbone network MobileNet v2 to the pre-trained weights on the ImageNet dataset through transfer learning technology; the training process adopts the frozen backbone strategy: lock the backbone network parameters in the first 50 training rounds to maintain the stability of the pre-trained weights, avoid destroying the existing feature structure in the early stage of training, and speed up the reasoning speed; after 50 rounds of frozen training, unfreeze the backbone network to enable it to participate in the weight update of the entire network. A lower learning rate is used in this stage to ensure that the backbone network can gradually adapt to the characteristics of the new data.

[0029] Step 3: To address the problem of data imbalance in power grid inspection, a loss function combining Focal Loss and Dice coefficient fine-tuning is used. The mathematical expression of this loss function is:

[0030]

[0031] Where the balance factor α controls the imbalance between positive and negative samples, the modulation coefficient γ controls the imbalance between difficult and easy samples, p is the label, and q is the predicted probability.

[0032] The Dice coefficient is defined as:

[0033]

[0034] Where X and Y represent the true result and the predicted result respectively.

[0035] Step 4: Use five-fold cross validation to evaluate the algorithm. The data set is divided into five subsets. In each round of training, a different subset is selected as the validation set, and the rest is used as the training set, and repeated for five rounds. Each round of training records various evaluation indicators, and finally calculates the average value of the five rounds of training as the overall performance of the model. The entire training process is based on the PyTorch framework, and the input image is adjusted to 512×512 pixels. Data enhancement methods include translation, flipping, Gaussian blur, and color gamut transformation. During the training process, the batch size used by the model in the freezing trunk stage is 24, which is reduced to 12 in the thawing stage. The learning rate optimization strategy uses cosine annealing to gradually reduce the learning rate.

[0036] The beneficial technical effects of the present invention are:

[0037] First, the lightweight backbone network MobileNet v2 of the present invention greatly reduces the number of parameters and computational complexity of the model, so that the model can be efficiently deployed on resource-constrained drone equipment, meeting the strict restrictions on computing resources for actual inspection tasks. Secondly, the lightweight large-scale void space pyramid pooling module proposed in the present invention enhances the model's modeling ability for narrow and long targets in power inspection scenarios, and is particularly suitable for identifying slender targets such as transmission lines under complex backgrounds. Through grouped mixed convolution and cross attention pooling, the feature extraction ability of the model in complex scenarios is effectively improved, and false detection and missed detection are reduced. Cross-attention wavelet fusion makes the information fusion between high-level and low-level features more effective, not only retains the spatial details of low-level features, but also enhances the expression ability of high-level features, significantly improving the multi-scale processing ability and segmentation accuracy of the model. The full-dimensional dynamic convolution post-processing module in the decoder further improves the feature detail recovery, ensures that the details of edges and small targets are retained in the predicted output, and improves the overall segmentation effect. Compared with mainstream semantic segmentation algorithms, the present invention performs well in accurately segmenting key targets in power systems, providing a more feasible solution for power grid automation inspection. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a schematic diagram of the lightweight semantic segmentation network structure of the present invention.

[0039] Figure 2 This is a schematic diagram of the grouped mixed convolution process.

[0040] Figure 3 This is the network structure diagram of the cross attention pooling layer.

[0041] Figure 4 This is the network structure diagram of the cross-attention wavelet fusion module.

[0042] Figure 5 This is the network structure diagram of the dynamic convolution post-processing module.

[0043] Figure 6 is the performance indicator obtained through cross validation. DETAILED DESCRIPTION

[0044] The present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0045] The lightweight semantic segmentation network for power grid inspection of the present invention is specially designed for semantic segmentation tasks in power grid inspection. Figure 1 As shown in the figure, an encoder-decoder architecture is adopted. In the encoder part, the original data is input into the lightweight MobileNet v2 backbone network for feature extraction, and the obtained feature map is input into the lightweight large-scale ASPP module, and the high-dimensional feature map is further multi-scale feature extracted. This module includes a series of 1×1 convolution layers, three groups of grouped mixed convolution layers with different expansion rates, and a group of cross-shaped attention pooling layers; in the decoder part, the high-dimensional features and low-dimensional features obtained by the backbone network are respectively input into the cross-attention wavelet fusion module, the spatial dimension and channel dimension are modeled for attention, and the two parts of information are feature fused. After the obtained feature map is fused with the output of the decoder, it is restored to the original data size through the downsampling operation through the full-dimensional dynamic convolution post-processing module to obtain the final prediction mask.

[0046] Among them, the principle of grouped mixed convolution process is as follows Figure 2 As shown in the figure, assuming that the number of input channels is M and the number of output channels is N, the specific steps of grouped mixed convolution are as follows:

[0047] (1) 5×5 grouped convolution: The input feature map is divided into M groups, and a layer-by-layer convolution of size 5×5×1 is used for each channel to extract local features.

[0048] (2) 3×3 layer-by-layer atrous convolution: After the grouped convolution, 3×3×1 layer-by-layer atrous convolution is performed in parallel on each channel.

[0049] (3) Point-wise convolution: Concatenate the feature maps of all channels in the channel dimension, apply 1×1×N point-wise convolution to aggregate information from different channels, and adjust the number of channels.

[0050] like Figure 3The figure shows the structure of the cross-shaped attention pooling layer. In order to make up for the feature loss problem caused by the parallel dilated convolution, the original ASPP module compensates for the global features by using parallel global average pooling. This method weights the average of all pixels and inevitably introduces interference from irrelevant information. Long-distance modeling methods including dilated convolution and global average pooling all capture feature information in a square window, lack the ability to model anisotropic contexts, and cannot effectively extract narrow and long features in inspections. Therefore, a cross-shaped attention pooling layer is designed to replace global average pooling.

[0051] Given a two-dimensional tensor Use two mutually perpendicular strip pooling cores to perform pooling operations along the horizontal or vertical spatial dimension, and the horizontal SP output for:

[0052]

[0053] Vertical SP output for:

[0054]

[0055] The horizontal and vertical strip pooling kernels capture the global features of rows and columns respectively, with sizes of H×1 and W×1. After one-dimensional convolution and expend operations, they are summed up and the feature map size is restored to H×W. After expansion and fusion, the generated tensor has the attention to narrow and long targets in both horizontal and vertical directions, and the feature weights are redistributed by dot multiplication with the original feature map.

[0056] like Figure 4 The figure shows the structure of the cross-attention wavelet fusion module. By using discrete wavelet transform, high-frequency components in different directions are selected to construct a new feature map, and it is concatenated with the original low-frequency component. The high-level feature map extracts channel information through an efficient channel attention mechanism to enhance the high-dimensional feature expression. Given an input After global average pooling without dimensionality reduction, it becomes For convolution operation, the size is further adjusted to After an adaptive one-dimensional convolution with a kernel size of k, there is a nonlinear mapping ψ between k and the channel dimension C:

[0057]

[0058] In the formula, τ odd represents the odd number closest to τ, γ and b are linear parameter terms, which are set to 2 and 1 respectively.

[0059] The low-dimensional features after the above operation are point-multiplied with the ECA weights of the high-dimensional features, and then concatenated with the original high-dimensional features in the channel dimension. The number of channels is adjusted through 1×1 convolution, and the final output is obtained after upsampling.

[0060] like Figure 5 The figure shows the structure of the dynamic convolution post-processing module. A learnable dynamic convolution module is introduced in a branch to dynamically adjust the spatial dimension, channel dimension, shape and size of the convolution kernel according to the characteristics of the input data to adapt to different input data. Its mathematical expression is:

[0061]

[0062] in represents the attention scalar of the convolution kernel, Represents three newly introduced attention scalars, which are calculated along the input channel dimension and output channel dimension of the convolution kernel Wi kernel space respectively.

[0063] In the other branch, the spatial attention mechanism weighted by global feature information is used. The global maximum pooling and global average pooling are used to aggregate the information of the feature map, and then the features are aggregated using 3×3 convolution to obtain the spatial feature weight of the branch. The weight is then multiplied by the corresponding pixel of the input feature map to obtain the output result. The output of the module is the result of the opposite addition of the feature maps of the two branches, and then the channel information is adjusted through 1×1 convolution.

[0064] The invention discloses a semantic segmentation method for a lightweight semantic segmentation network for power grid inspection. In the encoder stage, the MobileNet V2 backbone network is first used to extract features from the original data. Then, the ASPP module is reconstructed into a lightweight large-scale ASPP module. The high-dimensional feature graph is respectively subjected to parallel grouped mixed convolution and cross attention pooling to enhance the modeling capability of narrow and long targets while expanding the receptive field. In the decoder stage, cross-stage cross-attention wavelet fusion is introduced to combine low-level spatial information with high-level channel information. Through the spatial attention mechanism and Haar wavelet transform, high- and low-dimensional features are effectively fused, detail features are retained, and the model's processing capability for multi-scale features is increased. This feature graph is stacked with the multi-scale features output by the encoder, and a full-dimensional dynamic convolution post-processing module is used to adaptively adjust the parameters of the convolution kernel in multiple dimensions. The spatial attention mechanism of global feature weighting is combined to effectively improve the feature expression and detail recovery capability of the model. The data resolution is restored through bilinear interpolation to obtain a segmentation mask.

[0065] The specific steps include:

[0066] Step 1: Build a semantic segmentation dataset for power grid inspection scenarios. This dataset focuses on the common narrow and long features and various backgrounds in the power system. The dataset comes from open source aerial photography data and high-resolution images collected by power grid companies during actual inspections, and contains a total of 1,426 images. The target objects are divided into categories such as transmission lines, wooden transmission poles, and reinforced concrete poles, and pixel-level segmentation masks are manually annotated.

[0067] Step 2: Initialize the weights of the backbone network MobileNet v2 to the pre-trained weights on the ImageNet dataset through transfer learning technology; the training process adopts the frozen backbone strategy: lock the backbone network parameters in the first 50 training rounds to maintain the stability of the pre-trained weights, avoid destroying the existing feature structure in the early stage of training, and speed up the reasoning speed; after 50 rounds of frozen training, unfreeze the backbone network to enable it to participate in the weight update of the entire network. A lower learning rate is used in this stage to ensure that the backbone network can gradually adapt to the characteristics of the new data.

[0068] Step 3: To address the problem of data imbalance in power grid inspection, a loss function combining Focal Loss and Dice coefficient fine-tuning is used. The mathematical expression of this loss function is:

[0069]

[0070] In the formula, the balance factor α controls the imbalance of positive and negative samples, the modulation coefficient γ controls the imbalance of difficult and easy samples, p is the label, and q is the predicted probability.

[0071] The Dice coefficient is defined as:

[0072]

[0073] Where X and Y represent the true result and the predicted result respectively.

[0074] Focal Loss suppresses loss on common categories and imposes greater penalties on samples that are difficult to predict, thereby alleviating the problem of imbalance between positive and negative samples; the Dice coefficient optimizes the overlap of regions in the model segmentation results to ensure that a reasonable segmentation effect can be obtained even with very few samples. This loss function can not only handle category imbalance, but also reduce the shock caused by error changes during training.

[0075] Step 4: Use five-fold cross validation to evaluate the algorithm. Divide the dataset into five subsets. In each round of training, select different subsets as validation sets, and the rest as training sets. Repeat five rounds to ensure that each sample can appear as a validation dataset to improve the generalization ability of the model. Each round of training records various evaluation indicators, and finally calculates the average value of five rounds of training as the overall performance of the model. The entire training process is based on the PyTorch framework, and the input image is adjusted to 512×512 pixels. Data enhancement methods include translation, flipping, Gaussian blurring, and color gamut transformation to improve the adaptability of the model in different scenarios. During the training process, the batch size used by the model in the freezing trunk stage is 24, and it is reduced to 12 in the thawing stage to balance the video memory consumption and performance improvement. The learning rate optimization strategy uses cosine annealing to gradually reduce the learning rate so that the model adjusts its pace when it is close to convergence to improve stability.

[0076] The model test mainly uses indicators such as mIoU (mean intersection over union) and mPA (mean pixel accuracy) to evaluate the segmentation accuracy. Figure 6 As shown in the figure, the five-fold cross validation shows that the model performs superiorly in both accuracy and complexity, especially in the segmentation task of narrow and long objects.

[0077] The present invention improves the encoding and decoding structure of DeepLab v3+, designs a lightweight feature extraction and fusion strategy, and enables the model to show significant effects and advantages in power grid inspection tasks. First, the lightweight backbone network MobileNet v2 of the present invention greatly reduces the number of parameters and computational complexity of the model, so that the model can be efficiently deployed on resource-constrained drone equipment, meeting the strict restrictions on computing resources for actual inspection tasks. Secondly, the lightweight large-scale void space pyramid pooling module proposed in the present invention enhances the model's modeling ability for narrow and long targets in power inspection scenarios, and is particularly suitable for identifying slender targets such as transmission lines under complex backgrounds. Through grouped mixed convolution and cross attention pooling, the feature extraction ability of the model in complex scenarios is effectively improved, and false detection and missed detection are reduced. Cross-attention wavelet fusion makes the information fusion between high-level and low-level features more effective, not only retains the spatial details of low-level features, but also enhances the expression ability of high-level features, significantly improving the multi-scale processing ability and segmentation accuracy of the model. The full-dimensional dynamic convolution post-processing module in the decoder further improves the feature detail recovery, ensures that the details of edges and small targets are retained in the predicted output, and improves the overall segmentation effect. Compared with the mainstream semantic segmentation algorithm, this invention performs well in accurately segmenting key targets in the power system, providing a more feasible solution for power grid automation inspection.

Claims

1. A lightweight semantic segmentation network for power grid inspection, characterized by: An encoder-decoder architecture is adopted. In the encoder part, the original data is input into the lightweight MobileNet v2 backbone network for feature extraction, and the obtained feature map is input into the lightweight large-scale void spatial pyramid pooling ASPP module to further perform multi-scale feature extraction on the high-dimensional feature map. This module includes a series of 1×1 convolutional layers, three groups of grouped mixed convolutional layers with different expansion rates, and a group of cross-shaped attention pooling layers; in the decoder part, the high-dimensional features and low-dimensional features obtained by the backbone network are respectively input into the cross-attention wavelet fusion module, the spatial dimension and channel dimension are modeled for attention, and the two parts of information are feature fused. After the obtained feature map is fused with the output of the decoder, it is restored to the original data size through the full-dimensional dynamic convolution post-processing module through downsampling operation to obtain the final prediction mask.

2. A lightweight semantic segmentation network for power grid inspection according to claim 1, characterized in that: The grouped mixed convolution layer performs grouped mixed convolution as follows: Assume that the number of input channels is M and the number of output channels is N; (1) 5×5 grouped convolution: The input feature map is divided into M groups, and a layer-by-layer convolution of size 5×5×1 is used for each channel; (2) 3×3 layer-by-layer atrous convolution: After the grouped convolution, 3×3×1 layer-by-layer atrous convolutions are performed in parallel on each channel; (3) Point-wise convolution: Concatenate the feature maps of all channels in the channel dimension, apply 1×1×N point-wise convolution to aggregate information from different channels, and adjust the number of channels.

3. A lightweight semantic segmentation network for power grid inspection according to claim 1, characterized in that: The specific process of the cross-shaped attention pooling layer is: Given a two-dimensional tensor Use two mutually perpendicular strip pooling cores to perform pooling operations along the horizontal or vertical spatial dimension, and the horizontal SP output for: Vertical SP output for: The horizontal and vertical strip pooling kernels capture the global features of rows and columns respectively, with sizes of H×1 and W×1. After one-dimensional convolution and expend operations, they are summed up and the feature map size is restored to H×W. After expansion and fusion, the generated tensor has the attention to narrow and long targets in both horizontal and vertical directions, and the feature weights are redistributed by dot multiplication with the original feature map.

4. The lightweight semantic segmentation network for power grid inspection according to claim 1, characterized in that: The cross-attention wavelet fusion module constructs a new feature map by using discrete wavelet transform to select high-frequency components in different directions and concatenates it with the original low-frequency components; the high-level feature map extracts channel information through an efficient channel attention mechanism to enhance the high-dimensional feature expression. After global average pooling without dimensionality reduction, it becomes For convolution operation, the size is further adjusted to After an adaptive one-dimensional convolution with a kernel size of k, there is a nonlinear mapping ψ between k and the channel dimension C: In the formula, τ odd represents the odd number closest to τ, γ and b are linear parameter terms, set to 2 and 1 respectively; The low-dimensional features after the above operation are point-multiplied with the ECA weights of the high-dimensional features, and then concatenated with the original high-dimensional features in the channel dimension. The number of channels is adjusted through 1×1 convolution, and the final output is obtained after upsampling.

5. The lightweight semantic segmentation network for power grid inspection according to claim 1, characterized in that: The dynamic convolution post-processing module introduces a learnable dynamic convolution module in a branch, which dynamically adjusts the spatial dimension, channel dimension, shape and size of the convolution kernel according to the characteristics of the input data to adapt to different input data. Its mathematical expression is: in represents the attention scalar of the convolution kernel, Represents three newly introduced attention scalars, which are calculated along the input channel dimension and output channel dimension of the convolution kernel Wi kernel space; In the other branch, the spatial attention mechanism weighted by global feature information is used. The global maximum pooling and global average pooling are used to aggregate the information of the feature map, and then the features are aggregated using 3×3 convolution to obtain the spatial feature weight of the branch. The weight is then multiplied by the corresponding pixel of the input feature map to obtain the output result. The output of the module is the result of the opposite addition of the feature maps of the two branches, and then the channel information is adjusted through 1×1 convolution.

6. The semantic segmentation method of a lightweight semantic segmentation network for power grid inspection according to claim 1, characterized in that: The following steps are involved: Step 1: Build a semantic segmentation dataset for power grid inspection scenarios. This dataset focuses on the common narrow and long features and various backgrounds in the power system. The dataset comes from open source aerial photography data and high-resolution images collected by the power grid company during actual inspections, and contains a total of 1,426 images. The target objects are divided into categories such as transmission lines, wooden transmission poles, and reinforced concrete poles, and pixel-level segmentation masks are manually annotated. Step 2: Initialize the weights of the backbone network MobileNet v2 to the pre-trained weights on the ImageNet dataset through transfer learning technology; The training process adopts a frozen backbone strategy: the backbone network parameters are locked in the first 50 training rounds to maintain the stability of the pre-trained weights, avoid destroying the existing feature structure in the early stage of training, and speed up the inference speed; after 50 rounds of frozen training, the backbone network is unfrozen to participate in the weight update of the entire network. A lower learning rate is used in this stage to ensure that the backbone network can gradually adapt to the characteristics of the new data; Step 3: To address the problem of data imbalance in power grid inspection, a loss function combining Focal Loss and Dice coefficient fine-tuning is used. The mathematical expression of this loss function is: In the formula, the balance factor α controls the imbalance between positive and negative samples, the modulation coefficient γ controls the imbalance between difficult and easy samples, p is the label, and q is the predicted probability; The Dice coefficient is defined as: Where X and Y represent the actual result and the predicted result respectively; Step 4: Use five-fold cross validation to evaluate the algorithm. Divide the data set into five subsets. In each round of training, select a different subset as the validation set, and the rest as the training set. Repeat five rounds. Record various evaluation indicators in each round of training, and finally calculate the average value of the five rounds of training as the overall performance of the model. The entire training process is based on the PyTorch framework, and the input image is adjusted to 512×512 pixels. Data enhancement methods include translation, flipping, Gaussian blur, and color gamut transformation. During the training process, the model used a batch size of 24 in the freezing trunk stage and reduced it to 12 in the thawing stage; the learning rate optimization strategy adopted cosine annealing to gradually reduce the learning rate.

Citation Information

Patent Citations

  • Lightweight DeepLabV3 + image semantic segmentation method and device

    CN116704190A

  • Remote sensing image road segmentation method based on improved DeeplabV3 +

    CN117351372A

  • Unmanned aerial vehicle image semantic segmentation method based on dual-channel attention mechanism

    CN118691987A

Cited By

  • Wind power prediction method and device based on WTC-Informer algorithm, equipment and medium

    CN120106314A

  • Wind power prediction method, device, equipment and medium based on WTC-Informer algorithm

    CN120106314B

  • Target identification method, system and device for complex scene and medium

    CN120125954A

  • Pelvic fracture CT image segmentation method based on dynamic spatial feature enhancement module

    CN120219402A

  • Pelvic fracture CT image segmentation method based on dynamic spatial feature enhancement module

    CN120219402B