Electrical equipment ultraviolet discharge light spot image segmentation method and device based on DTDU-Net model, and storage medium
By adding a deformable convolutional residual encoder, a channel cross-fusion Transformer module and an ultra-lightweight dynamic upsampler to the U-Net model, the DTDU-Net model is built, which solves the problem of low segmentation accuracy in ultraviolet discharge spot image segmentation of electrical equipment, and achieves a high-precision spot segmentation effect.
Patent Information
- Application Number
- CN202510122033.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-06-06
AI Technical Summary
The prior art has low segmentation accuracy in the segmentation of ultraviolet discharge spot image segmentation of electrical equipment, and there is a problem of leakage segmentation, which is difficult to meet actual needs.
The ultraviolet discharge spot image segmentation method of electrical equipment based on the DTDU-Net model is adopted. The model adds a deformable convolutional residual encoder, a channel cross-fusion Transformer module and an ultra-lightweight dynamic upsampler based on the original U-Net to improve segmentation accuracy.
Through the DTDU-Net model, the segmentation accuracy of discharge spots in the ultraviolet image of electrical equipment is significantly improved, the possibility of incorrect segmentation is reduced, and the local area segmented can be better reconstructed, achieving high-precision segmentation effect.
Smart Images

Figure CN120107298A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image segmentation, and in particular to a method, a device and a storage medium for segmenting an ultraviolet discharge spot image of electrical equipment based on a DTDU-Net model. Background Art
[0002] As the electrification process enters a new era, continuously improving the stability of power supply has become an important part of my country's power construction. The long-term internal high voltage and strong current of power equipment and external environmental factors such as high temperature and heavy rain can easily cause wear, aging or failure of electrical and mechanical components inside the equipment, resulting in power supply interruptions, and even safety accidents in serious cases. Therefore, fast and accurate fault location and timely repair and maintenance are crucial for the safe and stable operation of the power grid system. Among them, partial discharge is a more obvious manifestation of defects on the insulation surface of some electrical equipment. The ultraviolet imager can visualize the ultraviolet light signal radiated during partial discharge as an ultraviolet light spot. By superimposing the visible light image, the inspector can accurately locate the discharge position. At the same time, the size of the light spot can also characterize the strength of the discharge to a certain extent. The accurate segmentation of the discharge light spot in the ultraviolet image and the calculation of the light spot area are very important steps for the subsequent evaluation of the discharge intensity.
[0003] At present, there are two commonly used methods for ultraviolet image segmentation. The first type is traditional image segmentation methods. These methods are simple and fast for ultraviolet image segmentation, but not intelligent enough. It is easy to produce mis-segmentation phenomenon for spot segmentation in complex backgrounds. The detection accuracy of the model is poor and cannot meet the requirements of actual conditions. The second type of method is based on the segmentation algorithm of deep learning. In the image segmentation of ultraviolet discharge spots of electrical equipment, some literatures use full convolutional networks to realize the autonomous segmentation and extraction of ultraviolet spots of electrical equipment discharge, but can only segment out the approximate area, and there is a serious problem of missed segmentation. Other literatures use the combination of traditional methods and deep learning methods for segmentation. For example, after the coarse segmentation of Deeplabv3+, the fine segmentation of the improved Otsu threshold segmentation algorithm is performed to improve the segmentation accuracy of the model, but the improvement link becomes complicated, and the segmentation effect still does not meet the required high-precision requirements. Based on the above improvement strategies, it can be concluded that how to further improve the spot segmentation accuracy of ultraviolet discharge spot image segmentation of electrical equipment has become a problem that needs to be solved in this field. Summary of the invention
[0004] The purpose of the present invention is to overcome the defect of poor spot segmentation accuracy in the above-mentioned prior art and to provide a method, device and storage medium for segmenting the ultraviolet discharge spot image of electrical equipment based on the DTDU-Net model.
[0005] The purpose of the present invention can be achieved by the following technical solutions:
[0006] According to a first aspect of the present invention, a method for segmenting an ultraviolet discharge spot image of electrical equipment based on a DTDU-Net model is provided, comprising the following steps: S1, obtaining an ultraviolet discharge spot image of electrical equipment; S2, segmenting the ultraviolet discharge spot image of electrical equipment using a trained DTDU-Net model to obtain an image segmentation result; wherein the DTDU-Net model is based on a U-Net model, comprises a deformable convolutional residual encoder and a channel cross-fusion Transformer module, and adopts an ultra-lightweight dynamic upsampler in the decoder part.
[0007] As a preferred technical solution, the deformable convolution residual encoder adds a residual structure to the original U-Net model encoder and replaces part of the standard convolution with a deformable convolution.
[0008] As a preferred technical solution, the output feature of the deformable convolution is expressed as:
[0009]
[0010] In the formula, x and y are the input and output feature maps of C×H×W dimensions, R is a 3×3 convolution kernel, and p 0 represents the central sampling point of the output feature map, p n Indicates p 0 The offset within the convolution kernel, w(p n ) indicates p n The weight at {Δp n |n=1,...,N} is the learnable offset, and N is the number of sampling points.
[0011] As an optimal technical solution, the channel cross-fusion Transformer module includes three steps: multi-scale feature embedding, multi-head cross-attention and multi-layer perceptron. The output of the deformable convolutional residual encoder is used as the input of the channel cross-fusion Transformer module. After three steps of processing, the channel output features are obtained. The channel output features are reconstructed and then spliced with the decoder features.
[0012] As a preferred technical solution, the multi-scale feature embedding step processes the output of the four jump connection layers of the encoder through the embedding layer and position encoding to obtain the input of the Transformer, and at the same time serves as the query matrix of the multi-head cross attention. The input of the Transformer is connected as the key and value, and then a similarity matrix is generated through the query matrix, key, and value, and the value is weighted by the similarity matrix through cross attention. Finally, the multi-head attention mechanism linearly transforms the input matrix to generate different query matrices, keys, and values for independent attention calculations, and weightedly splices the output of each head in the final fused representation to obtain a global self-attention feature map.
[0013] As an optimal technical solution, the ultra-lightweight dynamic upsampler is used to replace the upsampling operation of the original U-Net model. The specific operation process of the ultra-lightweight dynamic upsampler includes: for a given upsampling scale factor and feature map, using a preset linear layer to generate an offset; multiplying the offset by a preset static range factor, and the static range factor is used to locally constrain the moving range of the sampling position; reshaping the size of the constrained offset by pixel rearrangement, and obtaining a sampling set; through the grid_sample function, using the position of the sampling set to resample the assumed bilinear interpolation to obtain an upsampled feature map of the corresponding size.
[0014] As a preferred technical solution, the training and testing process of the DTDU-Net model specifically includes: S21, obtaining and annotating the ultraviolet spot image of electrical equipment discharge to construct a data set; S22, configuring a deep learning environment and setting the DTDU-Net model parameters; S23, inputting the data set into a preset DTDU-Net model for training and testing.
[0015] As a preferred technical solution, the DTDU-Net model uses class average intersection-over-union ratio and average pixel accuracy as evaluation indicators during testing.
[0016] According to a second aspect of the present invention, there is provided an electrical equipment ultraviolet discharge spot image segmentation device based on a DTDU-Net model, comprising a memory, a processor, and a program stored in the memory, wherein the processor implements the method when executing the program.
[0017] According to a third aspect of the present invention, there is provided a storage medium having a program stored thereon, wherein the program implements the method described above when executed.
[0018] Compared with the prior art, the present invention has the following beneficial effects:
[0019] 1. The present invention uses the DTDU-Net model to segment the ultraviolet discharge spot image of electrical equipment. The DTDU-Net model adds a deformable convolution residual encoder, a channel cross-fusion Transformer module, and an ultra-light dynamic upsampler DySample on the basis of the original U-Net, which can effectively improve the segmentation accuracy of the discharge spot in the ultraviolet image of electrical equipment;
[0020] 2. The deformable convolution residual encoder used in the present invention adds a residual structure to the original U-Net model encoder, and replaces part of the standard convolution with a deformable convolution. The residual structure is introduced in the encoder part, and the shallow information is directly transferred to the deep layer, which reduces the gradient disappearance problem, can capture richer feature information, and improve the model segmentation accuracy. At the same time, using deformable convolution to replace part of the standard convolution in the encoder can better extract the effective features of targets of different sizes and shapes, thereby improving the segmentation accuracy of the model;
[0021] 3. The present invention adopts the channel cross-fusion Transformer module to replace the jump connection. Compared with the traditional convolutional structure, by capturing cross-channel interactions, the network can understand the image content more comprehensively, thereby improving the accuracy of segmentation;
[0022] 4. The present invention adopts an ultra-light dynamic upsampler, which makes the segmentation boundary clearer by dynamically adjusting the processing details and edge information, thereby reducing the possibility of erroneous segmentation. At the same time, it can adjust the feature recovery method according to the context information, so that in some cases the local area that was missed can be better reconstructed. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic flow chart of the method provided by the present invention;
[0024] Figure 2 This is a schematic diagram of the deformable convolution principle in Example 1 of the present invention;
[0025] Figure 3 Schematic diagram of the structure of the original U-Net model encoder and the improved DRes17 encoder in Example 1 of the present invention;
[0026] Figure 4 This is a structural diagram of the CCT module and multi-head cross attention process in Example 1 of the present invention;
[0027] Figure 5 This is a Dysample upsampling flow chart in Embodiment 1 of the present invention;
[0028] Figure 6 The overall network structure diagram of the DTDU-Net model in Example 1 of the present invention;
[0029] Figure 7 This is a diagram showing the segmentation result of the ultraviolet discharge spot image of the electrical equipment in Example 1 of the present invention. DETAILED DESCRIPTION
[0030] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0031] Embodiment 1:
[0032] like Figure 1 As shown, this embodiment provides an electrical equipment ultraviolet discharge spot image segmentation method based on the DTDU-Net model, specifically including:
[0033] Step S1, obtaining an ultraviolet discharge spot image of an electrical device. In practical applications, the obtained ultraviolet discharge spot image of an electrical device may be historical data or real-time data.
[0034] Step S2, using the trained DTDU-Net model to segment the aforementioned electrical equipment ultraviolet discharge spot image to obtain an image segmentation result; wherein, the DTDU-Net (Residual Block include DeformableConvolution, Channel-wise Cross Fusion Transformer and DySample based U-Net) model is based on the U-Net model, including a deformable convolution residual encoder and a channel cross fusion Transformer module, and an ultra-light dynamic upsampler DySample is used in the decoder part.
[0035] In the DTDU-Net model, Residual Block refers to the residual structure, Deformable Convolution refers to the deformable convolution, hereinafter referred to as DCN; Channel-wise Cross Fusion Transformer refers to the channel cross fusion Transformer module, hereinafter referred to as the CCT module; DySample refers to the ultra-light dynamic upsampler. Specifically, the deformable convolution residual encoder (ie DRes17) uses Residual Block and DCN to replace the encoder of the original U-Net model, and the CCT module is used to replace the jump connection in the original U-Net model. In the decoder part, DySample is used to replace the original upsampling operation to improve the segmentation accuracy of the model.
[0036] The structure of each part of the DTDU-Net model is described as follows:
[0037] The first part is the deformable convolutional residual encoder, namely the DRes17 encoder.
[0038] The deformable convolution residual encoder DRes17 adds a residual structure to the original U-Net model encoder and replaces some standard convolutions with deformable convolution DCN. DCN is a variant convolution operation in convolutional neural networks. It adaptively learns the offset of each sampling point based on the standard convolution. It can dynamically adjust the position of the sampling point during the convolution process to make the shape of the convolution kernel closer to the target foreign body, and enhance the model's adaptive feature extraction ability for deformable targets. Its structure is as follows: Figure 2 shown.
[0039] The standard 3×3 convolution output features are shown below:
[0040]
[0041] In the formula, x and y are the input and output feature maps of C×H×W dimensions, R is a 3×3 convolution kernel, and p 0 represents the central sampling point of the output feature map, p n Indicates p 0 The offset within the convolution kernel, w(p n ) indicates p n The weight of .
[0042] Based on the standard convolution, DCN introduces a learnable offset {Δp n |n=1,...,N}, N represents the sampling point, and the DCN output characteristics are shown as follows:
[0043]
[0044] This embodiment introduces a residual structure into the original U-Net model encoder and uses DCN to replace part of the standard convolution. Figure 3 As shown, Figure 3 Part (a) is the original U-Net model encoder. Figure 3 Part (b) is the improved DRes17 encoder.
[0045] The second part is the channel cross-fusion Transformer module, namely the CCT module.
[0046] The CCT module combines the characteristics of the multi-scale encoder and the advantages of the Transformer long dependency modeling, captures cross-channel interactions, and fills the semantic information gap between low-level and high-level features. The CCT module consists of three steps: multi-scale feature embedding, multi-head cross-attention (MCA), and multi-layer perceptron (MLP). The output of the DRes17 encoder is used as the input of the CCT module. After three steps of processing, the channel output features are obtained. The channel output features are reconstructed and then concatenated with the decoder features. The CCT module and multi-head cross-attention process are as follows: Figure 4 Specifically:
[0047] First, the multi-scale feature embedding step allows the output E of the four skip connection layers of the encoder to be i (i=1,2,3,4) is processed by embedding layer and position encoding to get the input T of Transformer i (i=1,2,3,4), and at the same time as the query matrix (Query, Q) of MCA, T i Concatenate into T Σ =Concat(T 1 ,T 2 ,T 3 ,T 4 ) as the key (Key, K) and value (Value, V), the calculation is as follows:
[0048]
[0049] In the formula, W K , W V is a trainable weight matrix for different inputs.
[0050] Then, through Q i , K, V generate similarity matrix M i , and through Cross-Attention (CA), the value V is transferred from M i Weighted, as shown below:
[0051]
[0052] In the formula, C i (i=1,2,3,4) are the channel sizes of the four skip connection layers, ψ(·) and σ(·) represent instance normalization and softmax activation function.
[0053] Finally, the multi-head attention mechanism linearly transforms the input matrix to generate different Q, V, and K for independent attention calculations, and weightedly concatenates the output of each head in the final fused representation to obtain a global self-attention feature map.
[0054] The output after multi-head cross attention is as follows:
[0055]
[0056] Where N is the number of heads. In the experiment, N is set to 4. After passing through MLP and residual operator, the channel cross-fusion Transformer output is obtained:
[0057] O i =MCA i +MLP(Q i +MCA i ) (7)
[0058] For the sake of simplicity, the layer normalization (LN) operation is omitted. In addition, Figure 4 In the scaled dot product attention mechanism, Scale+psi means scaling and adjustment, and Transpose means transposition.
[0059] Repeat 4 times to build a 4-layer Transformer. The output after 4 layers is O i (i=1,2,3,4) and then reconstruct the features respectively with the decoder features D i (i=1,2,3,4) for splicing.
[0060] Compared with the traditional convolutional structure, the Transformer structure contained in the CCT module can capture cross-channel interactions, allowing the network to understand the image content more comprehensively, thereby improving the accuracy of segmentation. The multi-head cross-attention mechanism can dynamically adjust the channel weights, allowing the network to more effectively capture and utilize the correlation between different channels, thereby enhancing the diversity and richness of feature representation, paying more attention to useful feature information, reducing mis-segmentation, and thus improving segmentation accuracy.
[0061] The third part, the decoder, uses the ultra-lightweight dynamic upsampler DySample.
[0062] The DySample upsampler is used to replace the upsampling operation of the original U-Net model. The DySample upsampler is described from the perspective of point sampling, which can improve the image upsampling quality while saving computing resources. The Dysample upsampling flow chart is as follows Figure 5 As shown, Figure 5 Part (a) is a schematic diagram of the structure flow of the Dysample upsampler. Figure 5 Part (b) is a schematic diagram of the structure flow of the sampling point generator in the Dysample upsampler. Based on this, the specific operation flow of the DySample upsampler is as follows:
[0063] First, for a given upsampling scale factor s and a feature map X of size C×H×W, a preset linear layer is used to generate a feature map of size 2s 2 ×H×W offset O, the number of input and output channels of the linear layer are C and 2s respectively 2 ; Note that for a point in X, its s 2 The sampling positions need to change the initial sampling positions from the positions that should be fixed at the standard grid points to the bilinear initialization positions;
[0064] Next, in order to alleviate the problem that the unconstrained moving range of the offset may cause disordered sampling points, the offset O needs to be multiplied by a preset static range factor so that the moving range of the sampling position is locally constrained; in this embodiment, the offset O is multiplied by a static range factor of 0.25, as shown in the following formula:
[0065] O=0.25linear(X) (8)
[0066] Then, it is reshaped into 2×sH×sW size by pixel rearrangement, where the first dimension of 2 represents the x and y coordinates, and the sampling set S is obtained, which is the sum of the offset O and the original sampling grid G, that is:
[0067] S=O+G (9)
[0068] The reshape operation is omitted.
[0069] Finally, through the grid_sample function, the assumed bilinear interpolation is resampled using the position of the sampling set S to obtain an upsampled feature map X′ of size C×sH×sW, as shown in the following formula:
[0070] X′=gridsample(X,S) (10)
[0071] Compared with the original upsampling operation, the Dysample upsampler makes the segmentation boundary clearer by dynamically adjusting the processing details and edge information, thereby reducing the possibility of incorrect segmentation. At the same time, it can adjust the feature recovery method according to the context information, so that in some cases the local area that was missed can be better reconstructed.
[0072] Figure 6Part (a) is a schematic diagram of the overall structure of the DTDU-Net model in this embodiment, and part (b) is a local enlarged view of the residual structure (Res-Block-B and Res-Block-D). Img in part (a) represents the input image, Embedd represents embedding, Reconstruct represents reconstruction, and Conv represents convolution. In the figure, the DTDU-Net model introduces a residual structure and uses DCN to replace some standard convolutions for the encoder network in the original U-Net model, reducing the gradient vanishing problem, better extracting effective features of targets of different sizes and shapes, and enhancing the encoder feature extraction capability. Specifically: The DRes17 encoder has a total of 5 layers. The first layer contains a 7x7 convolution layer. The second to fifth layers can be regarded as the same residual blocks with different numbers of channels, and each residual block consists of two different residual structures. The first part is similar to the DownBlock structure in ResNet18, containing two 3x3 convolutional layers, and the jump connection uses 1x1 convolution, denoted as D-Block (i.e., Res-Block-D in the figure). The second part is similar to the BasicBlock structure, which contains two 3x3 convolutional layers and a no-operation jump connection, denoted as B-Block (i.e., Res-Block-B in the figure). The residual structure directly transfers shallow information to the deep layer through jump connections, reduces the gradient vanishing problem, and can capture richer feature information. In addition to the residual structure, the 7x7 large convolution kernel added to the improved encoder URes17 can obtain a larger receptive field, thereby capturing more contextual information. Among them, the standard convolution of the fourth and fifth layers of B-Block is replaced by deformable convolution DCN. Secondly, the jump connection part of the original U-Net model is replaced by the CCT module to capture cross-channel interactions and make up for the semantic information gap between low-level and high-level features. The multi-head cross attention mechanism can dynamically adjust the channel weights, so that the network can more effectively capture and utilize the correlation between different channels, thereby enhancing the diversity and richness of feature representation, paying more attention to useful feature information, reducing mis-segmentation, and improving segmentation accuracy. Finally, the DySample upsampler is added to the original U-Net network decoder to improve the image upsampling quality while saving computing resources.
[0073] Next, the training and testing process of the DTDU-Net model is introduced, which includes the following steps:
[0074] S21, obtaining and annotating the ultraviolet spot image of the electrical equipment discharge to construct a data set.
[0075] Specifically, after constructing the data set, the data set is divided into a training set, a validation set, and a test set in a ratio of 8:1:1. In this embodiment, the ultraviolet spot images of electrical equipment discharge used for training and testing are historical data, and the spots in the ultraviolet discharge spot images of electrical equipment are data labeled, and finally 1280 training sets, 160 validation sets, and 160 test sets are obtained.
[0076] S22, configure the deep learning environment and set the DTDU-Net model parameters.
[0077] Specifically, in this embodiment, the operating system is Windows 10 64-bit, the processor is Intel(R) Core(TM) i5-13400F, the graphics card is NVIDIA GeForce RTX 4060, the RAM size is 16G, the Python version used in the experiment is 3.8, the CUDA version is 11.1, the deep learning framework is PyTorch1.8.1, the training cycle (epochs) is set to 100, the batch size (batchsize) is 4, the stochastic gradient descent (SGD) optimizer is used, and the initial learning rate is 0.0001.
[0078] S23, input the data set into the preset DTDU-Net model for training and testing.
[0079] Specifically, the training set of ultraviolet discharge spots of electrical equipment is input into the DTDU-Net model for training. The validation set is used for verification during the training process, and the trained model is tested with the test set.
[0080] In addition, this embodiment uses the class average intersection over union (MIoU) and the average pixel accuracy (MPA) as evaluation indicators.
[0081] Among them, the calculation method of class average intersection-over-union ratio MIoU and average pixel accuracy MPA is:
[0082]
[0083] In the formula, k represents the number of target categories, p ii represents the number of correctly classified pixels, p ij represents the number of pixels of the i-th class predicted to be the j-th class, p ji It indicates the number of pixels of the jth class that are predicted to be of the ith class.
[0084] Next, the effectiveness of the method provided in this embodiment is verified.
[0085] The DTDU-Net model designed above adds a deformable convolution residual encoder, a channel cross-fusion Transformer, and an ultra-light dynamic upsampler DySample on the basis of the original U-Net to improve the segmentation accuracy of discharge spots in ultraviolet images of electrical equipment. Based on this model, step S2 is executed, that is, the ultraviolet discharge spot image of electrical equipment is segmented using the trained DTDU-Net model.
[0086] Figure 7 The comparison diagram of the segmentation results obtained by using the method provided in this embodiment. In this embodiment, the trained DTDU-Net model is evaluated, and it can be found that the MIoU of the present invention on the electrical equipment ultraviolet discharge spot data set reaches 95.17%, and the MPA reaches 96.79%. It meets the high-precision requirements of electrical equipment ultraviolet discharge spot image segmentation.
[0087] Example 2
[0088] This embodiment is a device for segmenting ultraviolet discharge spot images of electrical equipment based on the DTDU-Net model, including a memory, a processor, and a program stored in the memory, and the processor implements one or more steps of the method in Example 1 when executing the program. In some embodiments, the device includes an image acquisition module and an image segmentation module. The image acquisition module is used to acquire the ultraviolet discharge spot image of the electrical equipment, and the image segmentation module is used to segment the aforementioned ultraviolet discharge spot image of the electrical equipment using the trained DTDU-Net model to obtain the image segmentation result. Among them, the structure of the DTDU-Net model is the same as the DTDU-Net model structure in Example 1, which is not repeated here. Optionally, the device also includes three modules: a data set construction module, an environment and parameter configuration module, and a model training and testing module. These three modules are used to obtain the trained DTDU-Net model so that the model can be put into practical application. Specifically, the data set construction module is used to acquire and annotate the ultraviolet spot image of the electrical equipment discharge, construct a data set, such as the 1600 images in Example 1, and divide it into a training set, a verification set, and a test set in a ratio of 8:1:1. The environment and parameter configuration module is used to configure the deep learning environment and set the DTDU-Net model parameters. The model training and testing module is used to input the electrical equipment ultraviolet discharge spot data set into the DTDU-Net model for training and testing. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of each of the aforementioned modules can refer to the corresponding process in Example 1, which will not be repeated here.
[0089] Furthermore, this embodiment also provides a storage medium on which a program is stored, and when the program is executed, one or more steps of the method in embodiment 1 are implemented. Storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. According to the definition in this embodiment, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carriers.
[0090] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A method for segmenting ultraviolet discharge spot images of electrical equipment based on the DTDU-Net model, characterized in that: The following steps are involved: S1, obtaining an image of an ultraviolet discharge spot of an electrical device; S2, using the trained DTDU-Net model to segment the ultraviolet discharge spot image of the electrical equipment to obtain an image segmentation result; The DTDU-Net model is based on the U-Net model, including a deformable convolutional residual encoder and a channel cross-fusion Transformer module, and uses an ultra-light dynamic upsampler in the decoder part.
2. The method for segmenting the ultraviolet discharge spot image of electrical equipment based on the DTDU-Net model according to claim 1 is characterized in that: The deformable convolution residual encoder adds a residual structure to the original U-Net model encoder and replaces part of the standard convolution with a deformable convolution.
3. The method for segmenting the ultraviolet discharge spot image of electrical equipment based on the DTDU-Net model according to claim 2 is characterized in that: The output feature of the deformable convolution is expressed as: In the formula, x and y are the input and output feature maps of C×H×W dimensions, R is a 3×3 convolution kernel, p0 represents the central sampling point of the output feature map, and p n represents the offset of p0 within the convolution kernel range, w(p n ) indicates p n The weight at {Δp n |n=1,...,N} is the learnable offset, and N is the number of sampling points.
4. The method for segmenting the ultraviolet discharge spot image of electrical equipment based on the DTDU-Net model according to claim 1, characterized in that: The channel cross-fusion Transformer module includes three steps: multi-scale feature embedding, multi-head cross-attention and multi-layer perceptron. The output of the deformable convolutional residual encoder is used as the input of the channel cross-fusion Transformer module. After processing in three steps, the channel output features are obtained. The channel output features are reconstructed and then spliced with the decoder features.
5. The method for segmenting the ultraviolet discharge spot image of electrical equipment based on the DTDU-Net model according to claim 4 is characterized in that: In the multi-scale feature embedding step, the output of the four skip connection layers of the encoder is processed through the embedding layer and position encoding to obtain the input of the Transformer, which is also used as the query matrix of the multi-head cross attention. The input of the Transformer is connected as the key and value, and then a similarity matrix is generated through the query matrix, key, and value, and the value is weighted by the similarity matrix through cross attention. Finally, the multi-head attention mechanism linearly transforms the input matrix to generate different query matrices, keys, and values for independent attention calculations, and weights the output of each head in the final fused representation to obtain a global self-attention feature map.
6. The method for segmenting the ultraviolet discharge spot image of electrical equipment based on the DTDU-Net model according to claim 1, characterized in that: The ultra-light dynamic upsampler is used to replace the upsampling operation of the original U-Net model. The specific operation process of the ultra-light dynamic upsampler includes: For a given upsampling scale factor and feature map, an offset is generated using a preset linear layer; Multiplying the offset by a preset static range factor, where the static range factor is used to locally constrain the movement range of the sampling position; Reshape the size of the constrained offset by pixel rearrangement and obtain a sample set; The grid_sample function is used to resample the assumed bilinear interpolation using the positions of the sampling set to obtain an upsampled feature map of the corresponding size.
7. The method for segmenting the ultraviolet discharge spot image of electrical equipment based on the DTDU-Net model according to claim 1, characterized in that: The training and testing process of the DTDU-Net model specifically includes: S21, obtaining and annotating the ultraviolet spot image of the electrical equipment discharge to construct a data set; S22, configure the deep learning environment and set the DTDU-Net model parameters; S23, inputting the data set into a preset DTDU-Net model for training and testing.
8. The method for segmenting the ultraviolet discharge spot image of electrical equipment based on the DTDU-Net model according to claim 7, characterized in that: The DTDU-Net model uses class average intersection-over-union and average pixel accuracy as evaluation indicators during testing.
9. A device for segmenting ultraviolet discharge spot images of electrical equipment based on the DTDU-Net model, comprising a memory, a processor, and a program stored in the memory, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.
10. A storage medium having a program stored thereon, characterized in that: When the program is executed, the method according to any one of claims 1 to 8 is implemented.