Deeplabv3 +-based ultraviolet image discharge light spot segmentation and correction method
Multi-scale feature extraction and segmentation of UV images is carried out through the neural network model based on Deeplabv3+, which solves the problem of difficult separation of complex backgrounds and small spots in traditional methods, achieves precise segmentation and area correction of discharge spots in UV images, and improves electrical equipment Accuracy of insulation performance assessment.
Patent Information
- Application Number
- CN202410828284.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-10-29
AI Technical Summary
Traditional UV image segmentation methods face problems such as difficulty in separating complex backgrounds and small light spots, complex feature selection, and low segmentation accuracy in electrical equipment.
The neural network model based on Deeplabv3+ is used to perform multi-scale feature extraction and segmentation of ultraviolet images through the encoding module, spatial pyramid pooling module and decoding module, and the inverse residual unit, hole separable convolution and decoding module are combined to realize the discharge spot Accurate segmentation, and correct the spot area to uniform distance and gain conditions through the normalization correction method.
It achieves accurate detection and robust segmentation of discharge spots in UV images, outputs pixel-level segmentation results, and improves the accuracy of insulator operating status assessment and the ability to quantify insulation performance.
Smart Images

Figure CN118864489A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of ultraviolet image processing of electrical equipment, and in particular relates to a method for segmenting and correcting ultraviolet image discharge spots based on Deeplabv3+. Background Art
[0002] With the development of power systems and the increase in voltage, electrical equipment such as insulators face the test of various environments and working conditions during operation, and may have problems such as surface pollution, aging, and breakage. There are many hidden defects that are not easy to find through visual inspection or traditional non-destructive testing methods. Under the action of long-term electric fields, insulators may produce local discharge, further reduce the insulation performance, and may even cause breakdown and fracture of insulators, seriously threatening the safe and stable operation of transmission lines.
[0003] At present, "solar-blind" ultraviolet imagers have been used in the operation and maintenance of insulators. They use ultraviolet imaging technology to detect the corona discharge generated by insulators. Compared with traditional detection methods, ultraviolet imaging can achieve non-contact live detection and can promptly discover early slight discharges. It also has the advantages of strong anti-interference ability, accurate positioning, and intuitive results.
[0004] In the ultraviolet inspection of electrical equipment, the number of photons displayed by the ultraviolet imager can represent the discharge intensity, but the noise around the equipment will make the photon number parameter inaccurate. In addition, if there is more than one discharge point, the photon number cannot provide specific information of different discharge areas. Therefore, it is necessary to segment the ultraviolet image to obtain the discharge spot area, so as to make the insulator operating status assessment result more accurate.
[0005] The traditional segmentation method is to grayscale the UV image and obtain a binary image by setting a threshold value by yourself, and then remove the small area noise of the binary image by mathematical morphology filtering to achieve the extraction and quantification of the discharge area. However, this threshold segmentation method is only effective when the gray value difference between the target and the background is large. It is more dependent on the rationality of the artificially designed feature information and will misjudge the non-discharge area when the background is complex. Summary of the invention
[0006] In order to solve the technical problem: the traditional image segmentation method of ultraviolet image faces problems such as difficulty in separating complex background and small light spots, complex feature selection, and low segmentation accuracy in the ultraviolet detection task of electrical equipment.
[0007] The present invention provides the following technical solutions:
[0008] First,
[0009] The present invention provides a method for segmenting discharge spots of ultraviolet images based on Deeplabv3+, comprising the following steps:
[0010] Step S1, obtaining a data set of ultraviolet images;
[0011] Step S2, marking the discharge area of the ultraviolet image in the data set, and performing data preprocessing, dividing the preprocessed data set into a training set, a verification set and a test set;
[0012] Step S3, building an improved Deeplabv3+ neural network model, where the improved Deeplabv3+ neural network model consists of an encoding module, a spatial pyramid pooling module, and a decoding module;
[0013] The encoding module includes several reverse residual units, which are used as the backbone to extract UV image features;
[0014] The spatial pyramid pooling module extracts multi-scale features of UV images through four parallel dilated separable convolutions with different dilation rates and fuses these multi-scale features.
[0015] The decoding module performs multiple upsampling and dilated separable convolution (ASC) operations on the output of the spatial pyramid pooling module to fuse shallow features with deep features, and finally restores the initial resolution of the UV image to achieve the segmentation of the discharge spot.
[0016] Step S4, setting the hyperparameters for training the improved Deeplabv3+ neural network model, inputting the training set images in step S2 into the improved Deeplabv3+ neural network model for training, and using the validation set for validation to obtain an optimized improved Deeplabv3+ neural network model;
[0017] Step S5: Use the optimized improved Deeplabv3+ neural network model to identify and predict the ultraviolet images in the test set to obtain an ultraviolet image segmentation result map.
[0018] Furthermore, in step S3, the reverse residual unit first expands the input channel through a 1×1 convolution, then keeps the number of channels unchanged, performs a 3×3 depth convolution, and finally applies another 1×1 convolution to reduce the number of channels; each convolution operation of the reverse residual unit is processed by batch normalization BN and ReLU activation function.
[0019] Furthermore, in step S3, the input and output of the reverse residual unit are connected via a short circuit.
[0020] Furthermore, in step S3, the dilation rates of the four dilated separable convolutions are 1, 6, 12, and 18 respectively; for a convolution kernel with a dilation rate of r, if the standard convolution is k×k, then the dilated separable convolution is equivalent to inserting r-1 zeros between the convolution kernels, so that the receptive field of the convolution kernel becomes k+(k+1)×(r-1).
[0021] Furthermore, in step S3, the dilated separable convolution is a convolution operation consisting of two parts, including depthwise convolution and pointwise convolution. The depthwise convolution performs convolution operations independently on each input channel, that is, the convolution kernel slides in the spatial dimension; the pointwise convolution uses 1×1 convolution to linearly combine the outputs of the depthwise convolution to mix the information between channels.
[0022] Furthermore, in step S3, the decoding module upsamples using bilinear interpolation, and then connects through the Concat function to fuse the shallow features and the deep features.
[0023] Second,
[0024] The present invention provides a method for correcting discharge spots of ultraviolet images based on Deeplabv3+, which adopts the above-mentioned segmentation method and also includes the following steps:
[0025] Step S6, calculating the discharge spot area in the segmented ultraviolet image;
[0026] Step S7, correcting the number of spot pixels collected at different observation distances and instrument gains by a normalization correction method, performing normalization correction in the order of distance and gain, or in the order of gain and distance, to obtain the discharge spot area under uniform observation conditions.
[0027] Furthermore, in step S6, the segmented ultraviolet image is a binary image, all pixels in the background are output as black, and pixels in the discharge area are output as red. The total number of pixels in the largest connected area of red pixels is counted to be the discharge spot area.
[0028] Further, in step S7, the distance is normalized based on the discharge spot area and the observation distance satisfying the expression S(l)=l -1.881 It is realized by the power function relationship, l is the observation distance, S(l) is the discharge spot area when the observation distance is l.
[0029] Further, in step S8, the gain is normalized based on the spot area and the instrument gain satisfying the expression S(g)=e 0.0706g It is realized by the exponential function relationship, g is the instrument gain, S(g) is the discharge spot area when the instrument gain is g.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] 1. The present invention proposes a segmentation method for ultraviolet image discharge spots based on Deeplabv3+, which directly relies on the input original image to complete the target recognition from the input end to the output end, does not require manual intervention in the segmentation process, and can output pixel-level segmentation results, so as to achieve more accurate and robust detection of ultraviolet image discharge spots and better formulate maintenance strategies.
[0032] 2. The method for correcting the discharge spot area proposed in the present invention realizes the correction of the spot area to a uniform distance and gain condition, which is convenient for evaluating and quantifying the strength of the discharge of the electrical equipment and its insulation performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a flow chart of the ultraviolet image discharge spot segmentation and correction method of the present invention;
[0034] Figure 2 Schematic diagram of the structure of the reverse residual unit of the present invention;
[0035] Figure 3 This is the first result image after ultraviolet image segmentation of the present invention;
[0036] Figure 4 This is the second result diagram after ultraviolet image segmentation of the present invention.
[0037] English abbreviations:
[0038] CONV is the convolution block,
[0039] IRU is the inverse residual unit.
[0040] ASC is a dilated separable convolution.
[0041] s is the step size of the convolution,
[0042] ReLU is the rectified linear unit activation function.
[0043] BN stands for batch normalization layer. DETAILED DESCRIPTION
[0044] The technical solution of the present invention will be clearly described below in conjunction with the accompanying drawings. Obviously, the described embodiments are not all embodiments of the present invention, and all other embodiments obtained by ordinary technicians in the field without making creative work are within the protection scope of the present invention.
[0045] Example 1
[0046] like Figure 1As shown, the present invention provides a method for ultraviolet image discharge spot segmentation based on Deeplabv3+, comprising the following steps:
[0047] Step S1, collecting a number of ultraviolet images to form a data set of ultraviolet images;
[0048] The data set of collected ultraviolet images is: several ultraviolet images of partial discharge of insulators obtained by using an ultraviolet imager.
[0049] Step S2, marking the discharge area in the ultraviolet image in the data set, and performing data preprocessing;
[0050] The Labelme annotation tool was used to annotate the discharge areas of the UV images in the dataset, and data enhancement was achieved through preprocessing operations such as rotation, cropping, and mirroring, expanding the dataset to 1,200 images.
[0051] The preprocessed dataset is divided into training set, validation set and test set in a ratio of 7:2:1.
[0052] Step S3, building an improved Deeplabv3+ neural network model;
[0053] Deeplabv3+'s neural network is a semantic-level convolutional neural network segmentation algorithm.
[0054] The improved neural network model of Deeplabv3+ consists of an encoding module, a spatial pyramid pooling module and a decoding module, which can realize pixel-level segmentation of ultraviolet image discharge spots from the input to the output.
[0055] ReLU is the rectified linear unit activation function, expressed as ReLU(x)=max(0,x). BN stands for batch normalization layer. If an inverse residual unit IRU block is strided, that is, the step size s is greater than 1, then the size of its input and output will be inconsistent and there will be no skip connections; in this case, the skip option is set to "False".
[0056] Compared with the original Deeplabv3+, the backbone network of the neural network model of the improved Deeplabv3+ in this embodiment uses an inverted residual unit (IRU) and uses a different number of network layers, making the method proposed in the present invention more lightweight. Specifically:
[0057] The encoding module is a feature extractor that uses several inverse residual units (IRUs) as the backbone to extract UV image features and reduce the original size of the UV image by 8 times (output step size = 8). Specifically:
[0058] like Figure 2 As shown in the figure, the reverse residual unit first expands the input channels through 1×1 convolution, then keeps the number of channels unchanged, performs a 3×3 depth convolution, and finally applies another 1×1 convolution to reduce the number of channels. Each convolution operation of the reverse residual unit is processed by batch normalization BN and ReLU corrected linear unit activation function.
[0059] There is a short-circuit connection between the input and output of the reverse residual unit, which allows the network to access unconvolved blocks, thereby preventing network degradation problems such as gradient disappearance or gradient explosion when the network is too deep, while maintaining the accuracy of the model while greatly reducing the computational complexity and the number of parameters.
[0060] Wherein, ReLU is a rectified linear unit activation function, and the expression of the ReLU rectified linear unit activation function is ReLU(x)=max(0,x).
[0061] The spatial pyramid pooling module extracts multi-scale features through four parallel atrous separable convolutions (ASC) with different atrous rates and fuses these multi-scale features. Specifically:
[0062] For a convolution kernel with a dilation rate of r, if the standard convolution is k×k, then the dilated separable convolution is equivalent to inserting r-1 zeros between the convolution kernels, so that the receptive field of the convolution kernel becomes k+(k+1)×(r-1).
[0063] The dilation rates of the four dilated separable convolutions are 1, 6, 12, and 18 respectively.
[0064] Atrous Separable Convolution ASC is a convolution operation consisting of two parts, including depthwise convolution and pointwise convolution.
[0065] Depthwise convolution performs convolution operations independently on each input channel, that is, the convolution kernel slides in the spatial dimension;
[0066] Point-wise convolution uses 1×1 convolution to linearly combine the output of depthwise convolution, thereby mixing the information between channels. Dilated separable convolution can expand the characteristics of the receptive field, significantly reduce the amount of calculation and parameters, and make the convolution operation more efficient.
[0067] The decoding module performs multiple upsampling and dilated separable convolution (ASC) operations on the output of the spatial pyramid pooling module to fuse shallow features with deep features, and finally restores the initial resolution of the UV image to achieve the segmentation of the discharge spot.
[0068] The upsampling uses bilinear interpolation, which is then connected through the Concat function, and the shallow features and deep features are fused through 1×1 convolution;
[0069] The output of the spatial pyramid pooling module is upsampled four times and concatenated with shallow features of the same dimension. The purpose of this is that the structure in the input should be consistent with the structure in the output, so that information can be easily shared from the shallow layers of the network (such as edges or shapes) to the deep layers.
[0070] Then, two 3×3 separable convolutions are applied, and finally a 1×1 convolution with a single channel and sigmoid activation is used to obtain a binary mask. The output after the 1×1 convolution is upsampled twice to restore the original size of the image, and finally restored to the initial resolution of the UV image to achieve the segmentation of the discharge spot.
[0071] Step S4, setting the hyperparameters for training the improved Deeplabv3+ neural network model, inputting the training set images in step S2 into the improved Deeplabv3+ neural network model for training, and using the validation set for validation to obtain an optimized improved Deeplabv3+ neural network model;
[0072] The training hyperparameters are set to use the Adam optimizer for training, the initial learning rate is 0.003, the input image resolution is 512×512, and the training epochs are 100.
[0073] The improved Deeplabv3+ neural network model was trained for a total of 100 rounds. The first 50 rounds were frozen training, and pre-trained weight transfer learning was used to accelerate the convergence of the model. The next 50 rounds were unfrozen training, and all convolutional layers participated in the training, completing the entire process from ultraviolet image discharge spot feature extraction to feature restoration.
[0074] The hardware environment of the experiment is:
[0075] The CPU is Intel(R) Core i5-9400F and the GPU is NVIDIA Geforce RTX2060.
[0076] Step S5, using the optimized improved Deeplabv3+ neural network model to identify and predict the ultraviolet images in the test set, and obtaining a segmentation result map of the ultraviolet images in the test set;
[0077] After training, the F1-score reached 81.1%. The segmentation results are shown in the figure below. Figure 3 and Figure 4 shown.
[0078] F1-score is a comprehensive evaluation indicator used to measure the balance between the precision and recall of a model. It is the harmonic mean of precision and recall, ranging from 0 to 1. The larger the value, the better the model effect.
[0079] Precision refers to the ratio of the number of correct pixels to the total number of predicted pixels, and recall refers to the ratio of the number of correct pixels to the total number of true pixels. The calculation formula is as follows.
[0080]
[0081] In the above formula, TP is the pixel whose label is the spot area and is predicted to be the spot area; FP is the pixel whose label is the background area but is predicted to be the spot area; TN is the pixel whose label is the spot area but is predicted to be the background area; FN is the pixel whose label is the background area and is predicted to be the background area.
[0082] Example 2
[0083] like Figure 1 As shown, the present invention provides a method for correcting ultraviolet image discharge spots based on Deeplabv3+, and the following steps are added on the basis of Example 1:
[0084] Step S6, calculating the discharge spot area in the segmented ultraviolet image;
[0085] The segmented UV image is a binary image, in which all the pixels in the background are output as black, and the pixels in the discharge area are output as red.
[0086] The calculation of the discharge spot area is achieved by using Python's opencv library to perform image connected component analysis. The total number of pixels in the largest connected area of red pixels is counted, which is the discharge spot area.
[0087] Calculated by python, Figure 3 The discharge spot area in the segmented UV image is 768 pixels. Figure 4 The area of the discharge spot in the segmented UV image is 120 pixels.
[0088] Since the two images were taken under different conditions, they need to be corrected to the unified conditions of an observation distance of 8m and an instrument gain of 80 before they can be compared.
[0089] in, Figure 3 The photo was taken 4m away from the UV imager, that is, the observation distance was 4m, and the instrument gain value was set to 95 when shooting.
[0090] Figure 4The photo was taken at a distance of 10.45m from the UV imager, that is, the observation distance was 10.45m, and the instrument gain was set to 90 when shooting.
[0091] Step S7, performing normalization correction on the discharge spot area in the order of distance and gain, or performing normalization correction in the order of gain and distance, wherein the normalization parameters are the observation distance and instrument gain, and obtaining the discharge spot area under uniform observation conditions.
[0092] The normalization correction method is used to correct the number of discharge spot pixels collected at different observation distances and instrument gains to a uniform condition, which is beneficial for evaluating the discharge intensity of insulating equipment such as insulators.
[0093] The normalization of the distance is based on the discharge spot area and the observation distance satisfying the expression S(l)=l -1.881 This is achieved by a power function relationship, and the discharge spot area and observation distance before and after correction both satisfy the power function relationship.
[0094] Assuming that the uniformly corrected observation distance is 5m, and the observation distance value measured by the laser ranging of the ultraviolet imager is l, and the discharge spot area in the ultraviolet image taken at this distance is calculated to be S(l), the discharge spot area after distance correction can be obtained as S(l5)=S(l)(l / 5) 1.881 .
[0095] The gain normalization is based on the discharge spot area and instrument gain satisfying the expression S(g) = e 0.0706g This is achieved by an exponential function relationship, and the discharge spot area and instrument gain before and after correction both satisfy the exponential function relationship.
[0096] Assuming that the uniformly corrected instrument gain is 80, and the instrument gain value set when the ultraviolet imager is shooting is g, and the discharge spot area in the ultraviolet image shot under this gain is calculated to be S(g) after distance correction, the discharge spot area after gain correction S(g) can be obtained. 80 )=S(g)e 0.0706(80-g) .
[0097] According to the normalization correction method, we can first Figure 3 The discharge spot area when the observation distance is 8m under the uniform condition is S3=768×(4 / 8) 1.881 =208.5, and then corrected to the discharge spot area when the instrument gain is 80 under the uniform conditions is S 3’ =208.5×e 0.0706(80-95) =72.3.
[0098] According to the normalization correction method, we can first Figure 4The discharge spot area in the discharge light spot is corrected to the observation distance of 8m under the unified conditions, which is S4=120×(10.45 / 8) 1.881 =198.35, and then corrected to the value of S when the instrument gain is 80 under the uniform conditions 4’ =198.35×e 0.0706(80-90) =97.9.
[0099] In this embodiment, it can be clearly seen from the segmented image that Figure 3 The discharge spot area ratio Figure 4 is much larger, but after correcting the area of the discharge spot according to the distance and gain value, we get Figure 3 The actual discharge spot area S under uniform conditions 3’ To be less than Figure 4 The actual discharge spot area S 4’ .
[0100] The above technical features constitute the best embodiment of the present invention, which has strong adaptability and best implementation effect. Non-essential technical features can be added or reduced according to actual needs to meet the needs of different situations.
[0101] Finally, it should be noted that the above content is only used to illustrate the technical solution of the present invention, rather than to limit the scope of protection of the present invention. Simple modifications or equivalent substitutions of the technical solution of the present invention by ordinary technicians in this field do not deviate from the essence and scope of the technical solution of the present invention.
Claims
1. A method for segmenting discharge spots in ultraviolet images based on Deeplabv3+, characterized in that: The steps include: Step S1, obtaining a data set of ultraviolet images; Step S2, marking the discharge area of the ultraviolet image in the data set, and performing data preprocessing, dividing the preprocessed data set into a training set, a verification set and a test set; Step S3, building an improved Deeplabv3+ neural network model, where the improved Deeplabv3+ neural network model consists of an encoding module, a spatial pyramid pooling module, and a decoding module; The encoding module includes several reverse residual units, which are used as the backbone to extract UV image features; The spatial pyramid pooling module extracts multi-scale features of UV images through four parallel dilated separable convolutions with different dilation rates and fuses these multi-scale features. The decoding module performs multiple upsampling and dilated separable convolution (ASC) operations on the output of the spatial pyramid pooling module to fuse shallow features with deep features, and finally restores the initial resolution of the UV image to achieve the segmentation of the discharge spot. Step S4, setting the hyperparameters for training the improved Deeplabv3+ neural network model, inputting the training set images in step S2 into the improved Deeplabv3+ neural network model for training, and using the validation set for validation to obtain an optimized improved Deeplabv3+ neural network model; Step S5: Use the optimized improved Deeplabv3+ neural network model to identify and predict the ultraviolet images in the test set to obtain an ultraviolet image segmentation result map.
2. The segmentation method according to claim 1, characterized in that: In step S3, the reverse residual unit first expands the input channel through 1×1 convolution, then keeps the number of channels unchanged, performs a 3×3 depth convolution, and finally applies another 1×1 convolution to reduce the number of channels; after each convolution operation of the reverse residual unit, it will be processed by batch normalization BN and ReLU activation function.
3. The segmentation method according to claim 2, characterized in that: In step S3, the input and output of the reverse residual unit are connected via a short circuit.
4. The segmentation method according to claim 1, characterized in that: In step S3, the dilation rates of the four dilated separable convolutions are 1, 6, 12, and 18 respectively; for a convolution kernel with a dilation rate of r, if the standard convolution is k×k, then the dilated separable convolution is equivalent to inserting r-1 zeros between the convolution kernels, so that the receptive field of the convolution kernel becomes k+(k+1)×(r-1).
5. The segmentation method according to claim 1, characterized in that: In step S3, the dilated separable convolution is a convolution operation consisting of two parts, including depthwise convolution and pointwise convolution. The depthwise convolution performs convolution operations independently on each input channel, that is, the convolution kernel slides in the spatial dimension; the pointwise convolution uses 1×1 convolution to linearly combine the output of the depthwise convolution to mix the information between channels.
6. The segmentation method according to claim 1, characterized in that: In step S3, the decoding module upsamples using bilinear interpolation and then connects through the Concat function to fuse the shallow features and deep features.
7. A method for correcting discharge spots in ultraviolet images based on Deeplabv3+, characterized in that: The segmentation method according to any one of claims 1 to 6 further comprises the following steps: Step S6, calculating the discharge spot area in the segmented ultraviolet image; Step S7, correcting the number of discharge spot pixels collected at different observation distances and instrument gains by a normalization correction method, performing normalization correction in the order of distance and gain, or performing normalization correction in the order of gain and distance, to obtain the discharge spot area under unified observation conditions.
8. The correction method according to claim 7, characterized in that: In step S6, the segmented ultraviolet image is a binary image, all the pixels in the background are output as black, and the pixels in the discharge area are output as red. The total number of pixels in the largest connected area of red pixels is counted, which is the discharge spot area.
9. The correction method according to claim 7, characterized in that: In step S7, the distance is normalized based on the discharge spot area and the observation distance satisfying the expression S(l)=l -1.881 It is realized by the power function relationship, l is the observation distance, S(l) is the discharge spot area when the observation distance is l.
10. The correction method according to claim 7, characterized in that: In step S8, the gain is normalized based on the spot area and the instrument gain satisfying the expression S(g)=e 0.0706g It is realized by the exponential function relationship, g is the instrument gain, S(g) is the discharge spot area when the instrument gain is g.
Citation Information
Cited By
High-sensitivity electric leakage insulation detection method and device for switch cabinet
CN120028663A
