Insulator surface pollution grade classification and model training method, device and equipment
By constructing a two-dimensional convolutional U-Net deep learning model coupled with an attention mechanism, the problems of low efficiency and low accuracy in classifying insulator surface contamination levels are solved, achieving efficient and accurate contamination level classification, and enhancing the interpretability of the model. and trust in results.
Patent Information
- Application Number
- CN202410890848.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-10-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods for classifying insulator surface contamination levels have problems such as strong subjectivity, low efficiency, poor real-time performance, high safety risks, and high costs. Moreover, the model generalization ability is limited, making it difficult to accurately classify complex contamination situations, and there is a problem of data imbalance.
The two-dimensional convolutional U-Net deep learning model (2DUNet-CA) using the coupled attention mechanism is used to build an initial classification model by collecting and labeling contamination images on the insulator surface, and uses the training set for model training, and combines the Focal Loss function to optimize the model , to solve the class imbalance problem.
It achieves efficient and accurate classification of insulator surface contamination levels, improves classification efficiency and accuracy, reduces the limitations of the model's generalization ability to new data sets, and enhances the model's interpretability and confidence in the results.
Smart Images

Figure CN118762227A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a method, device and equipment for classifying contamination levels on the surface of an insulator and training a model. Background Art
[0002] Insulators play a vital role in power systems. Their main function is to support and fix conductors while isolating the electrical connection between conductors and grounded parts such as towers. However, insulators will be affected by environmental factors such as dust, salt spray, industrial pollution, etc. during long-term outdoor use, resulting in surface contamination accumulation. These contaminants will reduce the insulation performance of insulators, increase the risk of flashover accidents in power systems, and pose a threat to the safe operation of power systems. Therefore, it is of great significance to classify and identify the contamination level of insulator surfaces.
[0003] Traditional pollution level classification methods mainly include manual inspection, laboratory testing and electrical parameter monitoring. Manual inspection is carried out by power workers regularly, using naked eye observation and manual recording of the pollution of insulators, which has the problems of strong subjectivity, low efficiency and poor safety. Laboratory testing takes insulator samples back to the laboratory and determines their pollution level by measuring physical parameters such as leakage current and surface pollution resistance, but the samples are limited, the detection process is time-consuming, and real-time detection is not possible, and the equipment cost is high. Electrical parameter monitoring indirectly reflects the pollution situation by online monitoring of electrical parameters such as leakage current and capacitance of insulators, but these parameters are affected by many factors and it is difficult to accurately reflect the degree of pollution. In addition, the equipment installation is complex, the data processing is complex, and the real-time and accuracy are difficult to guarantee. In general, the traditional method has the disadvantages of subjectivity and consistency, low efficiency, poor real-time performance, high safety risks and high cost, which limits its application effect and promotion in large-scale and wide-area transmission lines.
[0004] With the development of technology, spectroscopy and machine learning have become an effective solution, but first of all, they both require a large amount of data for training and analysis, especially when dealing with complex insulator surface contamination data, data acquisition and annotation may become a challenge. In addition, spectroscopy requires effective feature extraction of spectral data, and different types of insulator surface contamination may have different spectral characteristics, which increases the difficulty of feature extraction. In terms of machine learning, the generalization ability of the model may be limited, especially when faced with complex contamination situations, the model may not be accurately generalized to new data sets. In addition, some machine learning models may lack interpretability, making it difficult to understand how the model makes classification decisions, thereby reducing users' trust in the model results. Finally, there may be a data imbalance problem in the classification of insulator surface contamination, resulting in the model training results being biased towards categories with a larger number and ignoring categories with a smaller number. The emergence of deep learning has greatly promoted the development of insulator surface contamination level classification, and with its powerful nonlinear fitting ability, it has demonstrated excellent results in many aspects. Summary of the invention
[0005] The present invention provides a method, device and equipment for classifying and training a model of contamination levels on the surface of an insulator, so as to realize efficient classification of contamination levels on the surface of an insulator.
[0006] According to one aspect of the present invention, a method for training an insulator surface contamination level classification model is provided, comprising:
[0007] Collecting contamination images of the insulator surface, and marking the contamination images of the insulator surface to obtain a contamination level dataset of the insulator surface;
[0008] Dividing the insulator surface contamination level data set into a training set and a test set of an initial insulator surface contamination level classification model;
[0009] A two-dimensional convolutional U-Net deep learning model 2DUNet-CA coupled with an attention mechanism is constructed as an initial insulator surface contamination level classification model, and the initial insulator surface contamination level classification model is trained using a training set;
[0010] The initial insulator surface contamination level classification model includes: a convolution layer, an activation function, an upsampling layer, an attention mechanism layer, and a maximum pooling layer;
[0011] The initial insulator surface contamination level classification model is tested based on the test set, and when the test passes, a target insulator surface contamination level classification model is obtained.
[0012] According to another aspect of the present invention, a method for classifying the contamination level of an insulator surface is provided, comprising:
[0013] Obtaining a contaminated image of the surface of the insulator to be identified;
[0014] Inputting the contamination image of the insulator surface to be identified into a target insulator surface contamination level classification model to obtain a target insulator surface contamination level classification result corresponding to the contamination image of the insulator surface to be identified;
[0015] The target insulator surface contamination level classification model is obtained by training using the aforementioned insulator surface contamination level classification model training method.
[0016] According to another aspect of the present invention, there is provided a training device for an insulator surface contamination level classification model, comprising:
[0017] A data set generation module is used to collect the contamination images of the insulator surface and mark the contamination images of the insulator surface to obtain the insulator surface contamination level data set;
[0018] A data set division module, used for dividing the insulator surface contamination level data set into a training set and a test set of an insulator surface contamination level classification model;
[0019] A model building training module is used to build a two-dimensional convolutional U-Net deep learning model 2DUNet-CA coupled with an attention mechanism as an initial insulator surface contamination level classification model, and a training set is used to perform model training on the initial insulator surface contamination level classification model;
[0020] The initial insulator surface contamination level classification model includes: a convolution layer, an activation function, an upsampling layer, an attention mechanism layer, and a maximum pooling layer;
[0021] The model test evaluation module is used to test the initial insulator surface contamination level classification model based on the test set, and obtain the target insulator surface contamination level classification model when the test passes.
[0022] According to another aspect of the present invention, there is provided an insulator surface contamination level classification device, comprising:
[0023] The module for acquiring the image to be identified is used to acquire the contaminated image on the surface of the insulator to be identified;
[0024] A classification result determination module is used to input the contamination image of the insulator surface to be identified into a target insulator surface contamination level classification model to obtain a target insulator surface contamination level classification result corresponding to the contamination image of the insulator surface to be identified;
[0025] The target insulator surface contamination level classification model is obtained by training using the aforementioned insulator surface contamination level classification model training method.
[0026] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0027] at least one processor; and
[0028] a memory communicatively connected to the at least one processor; wherein,
[0029] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the insulator surface contamination level classification and model training method described in any embodiment of the present invention.
[0030] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the insulator surface contamination level classification and model training method described in any embodiment of the present invention when executed.
[0031] The technical solution of the embodiment of the present invention collects the contamination images of the insulator surface, annotates the obtained contamination images of the insulator surface, and obtains the insulator surface contamination level classification data set; divides the insulator surface contamination level data set into a training set and a test set; constructs a deep learning model 2DUNet-CA of a two-dimensional convolution U-Net coupled with an attention mechanism as an initial insulator surface contamination level classification model, and trains the model using a training set; the model includes: an upsampling layer, an attention mechanism layer, a maximum pooling layer, etc.; uses a test set to test the initial insulator surface contamination level classification model, and obtains a target insulator surface contamination level classification model when the test passes. The present invention solves the problems of low efficiency and low precision in the classification of insulator surface contamination levels, and realizes efficient insulator surface contamination level classification by constructing a network model coupled with an attention mechanism.
[0032] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0034] Figure 1A flowchart of a method for training an insulator surface contamination level classification model provided in the first embodiment of the present invention;
[0035] Figure 2 A schematic diagram of the 2DUNeT-CA structure provided in Embodiment 1 of the present invention;
[0036] Figure 3 The processing flow of the attention mechanism layer provided in the first embodiment of the present invention;
[0037] Figure 4 A flow chart of a method for classifying the contamination levels of insulator surfaces provided in the second embodiment of the present invention;
[0038] Figure 5 A comparison diagram of some insulators provided in the second embodiment of the present invention and their real labels and prediction results;
[0039] Figure 6 A schematic diagram of the structure of a training device for an insulator surface contamination level classification model provided in Embodiment 3 of the present invention;
[0040] Figure 7 A schematic diagram of the structure of an insulator surface contamination level classification device provided in Embodiment 4 of the present invention;
[0041] Figure 8 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0042] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0043] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0044] Embodiment 1
[0045] Figure 1 This is a flowchart of a method for training an insulator surface contamination level classification model provided in the first embodiment of the present invention. This embodiment is applicable to the case of training an initial insulator surface contamination level classification model. The method can be executed by an insulator surface contamination level classification model training device, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device. Figure 1 As shown, the method includes:
[0046] S110, collecting contamination images of the insulator surface, and marking the contamination images of the insulator surface to obtain a contamination level dataset of the insulator surface.
[0047] In the embodiment of the present invention, sufficient high-quality images of insulator surface contamination can be collected through drone inspection. Further, the surface contamination level of the insulator surface contamination images is labeled based on a dataset labeling tool (labelme).
[0048] Specifically, the labeling steps include: installing Anaconda, creating a suitable Python virtual environment, installing the matching version of labelme; opening the insulator surface pollution image to be labeled in labelme; and performing polygonal labeling based on the different pollution types contained in the image while maintaining the category balance as much as possible. The labeled results are saved in json format, and the relevant code is used to convert the json format annotation content into a visual png format label image, thereby constructing an insulator surface pollution level dataset.
[0049] S120, dividing the insulator surface contamination level data set into a training set and a test set of an initial insulator surface contamination level classification model.
[0050] In the embodiment of the present invention, the insulator surface contamination level data set may be divided into a training set and a test set in a ratio of 7:3.
[0051] S130. Construct a two-dimensional convolutional U-Net deep learning model 2DUNet-CA with a coupled attention mechanism as an initial insulator surface contamination level classification model, and use a training set to perform model training on the initial insulator surface contamination level classification model.
[0052] Among them, the initial insulator surface contamination level classification model includes: convolution layer, activation function, upsampling layer, attention mechanism layer, and maximum pooling layer.
[0053] In an embodiment of the present invention, the task characteristics of insulator surface contamination level classification can be fully considered, and a two-dimensional (2D) convolutional U-Net deep learning model is used as a basis. On this basis, an attention mechanism is coupled to obtain a two-dimensional convolutional U-Net deep learning model (2DUNeT-CA) coupled with an attention mechanism as an initial insulator surface contamination level classification model.
[0054] Two-dimensional convolution is a common technique in computer vision and image processing for processing two-dimensional image data. It is mainly used in image feature extraction, image filtering, edge detection and other tasks. The two-dimensional convolution operation usually uses a small matrix called a convolution kernel (or filter) to scan the input image. Each element in the convolution kernel is element-by-element multiplied with the corresponding area of the input image, and then all the product results are added to obtain the pixel value of the corresponding position in the output image. By moving the convolution kernel and performing this operation on the entire input image, the entire output image can be obtained. In the convolution operation, the size and shape of the convolution kernel and the stride of the convolution can be adjusted according to the needs of the task. By changing the weight of the convolution kernel, different feature extraction and filtering effects can be achieved. Common two-dimensional convolution operations include edge detection, blurring, sharpening, feature extraction, etc. In deep learning, the two-dimensional convolution layer is usually used as the basic building block of convolutional neural networks (CNNs) to learn feature representations in images, thereby achieving tasks such as image classification, object detection, and image segmentation.
[0055] The activation function of the initial insulator surface contamination level classification model is the ReLU activation function. The ReLU (RectifiedLinearUnit) activation function is defined as follows: when the input value is greater than zero, the output is the same as the input; when the input value is less than or equal to zero, the output is zero. Due to its simple calculation method, ReLU can effectively alleviate the gradient vanishing problem, accelerate the training of neural networks, and improve the performance and convergence speed of the model.
[0056] The attention mechanism is a technology that simulates the human visual or cognitive system. It is used to enable the model to selectively focus on different parts of the input data when processing sequence data (such as text, speech, images, etc.), thereby improving the performance and effect of the model. In the attention mechanism, the model can learn the importance of different positions or features in the input sequence, and then weight the representation of different parts according to these importance to produce the final output. The attention mechanism layer of the initial insulator surface contamination level classification model is the Channel Attention Model (CAM). The CAM layer obtains the weights of each channel by globally pooling the features of each channel, and multiplies the features by these weights to complete the channel response.
[0057] The MaxPoolingLayer is a commonly used pooling operation in deep learning convolutional neural networks. It is used to reduce the spatial size of the feature map, thereby reducing the amount of computation and the number of parameters of the model, and helps to extract the local invariance of the features. The MaxPoolingLayer usually controls the size and stride of the pooling area by specifying the pooling kernel size and stride, thereby adjusting the size of the output feature map.
[0058] The present invention constructs a two-dimensional convolutional U-Net deep learning model (2DUNeT-CA) with a coupled attention mechanism as an initial insulator surface contamination level classification model. The U-Net is used as the basis, and the structure of the VGG (Visual Geometry Group Network) model is adopted in the encoding part. After each upsampling in the decoding part, the feature reconstruction is completed through the coupled channel attention.
[0059] In an optional embodiment, a two-dimensional convolutional U-Net deep learning model 2DUNet-CA coupled with an attention mechanism is constructed as an initial insulator surface contamination level classification model, including: constructing an encoder and a decoder of the initial insulator surface contamination level classification model, and determining the initial insulator surface contamination level classification model based on the encoder and the decoder.
[0060] On the basis of the above technical solution, an encoder of the initial insulator surface pollution level classification model is constructed, including: connecting the convolution layer, the activation function, and the batch normalization processing layer to form an insulator surface pollution level classification convolution module corresponding to the encoder; connecting two of the above insulator surface pollution level classification convolution modules in series through a maximum pooling layer, repeating three times, to form an encoder of the initial insulator surface pollution level classification model.
[0061] Constructing a decoder of the initial insulator surface contamination level classification model includes: connecting upsampling, convolution layer, activation function and attention mechanism layer to form a decoder of the insulator surface contamination level classification model; wherein the attention mechanism layer is composed of a channel attention layer CAM. Figure 2 Schematic diagram of the 2DUNeT-CA structure provided in the first embodiment of the present invention. Figure 2As shown, the present invention combines CAM with VGG based on U-Net to obtain an initial insulator surface contamination level classification model. Among them, the convolution block of the encoder part of the initial insulator surface contamination level classification model consists of three parts. First, convolution is used to mine local features; second, Relu is used for nonlinear activation; third, the maximum pooling layer is used to enter the next scale, and the multi-scale feature extraction composition encoding part. Subsequently, CAM is used in the encoding part to change the channel response by introducing attention. The original information of the image is obtained through jump connection, and after multiple upsampling, full convolution is used to output the contamination level classification prediction map.
[0062] UNet is a classic neural network architecture for image segmentation, originally developed by researchers in the field of medical imaging to solve biomedical image segmentation tasks. Its name comes from its U-shaped network structure, which consists of a symmetrical encoder (downsampling path) and a decoder (upsampling path). The encoder is responsible for extracting features from the input image and reducing the spatial resolution, while the decoder is responsible for restoring the original resolution and generating segmentation results. UNet also introduces skip connections, which connect the feature maps of the corresponding layers in the encoder with the corresponding layers in the decoder to help the network better understand the local and global structures of the image and solve the problem of information loss during the segmentation process. In the decoder, the feature maps of the skip connection are fused with the feature maps in the decoder, usually by splicing or adding them, to improve segmentation performance. The UNet structure allows the network to extract information from feature maps of different scales simultaneously, thereby better adapting to targets of different sizes and shapes. Due to its simple and effective structure, UNet is widely used in image segmentation tasks in other fields.
[0063] The attention mechanism of the present invention uses CAM, which can update the weight of the channel dimension. The CAM layer obtains the weight of each channel through the input features through MLP (multi-layer perceptron), and then multiplies the corresponding features by these weights. The CAM layer can more accurately mine the importance of features, thereby improving the ability to classify the contamination level of the insulator surface.
[0064] In an optional embodiment, the processing flow of the attention mechanism layer is as follows: the initial feature map of surface contamination of insulators of different levels obtained by the encoding part is average pooled to obtain a 1×1×C CAM intermediate feature map of surface contamination of insulators of different levels; wherein C is the number of channels; the CAM intermediate feature map of surface contamination of insulators of different levels is input into a two-layer multi-layer perceptron MLP, and the activation function is used to obtain the channel attention weights of surface contamination of insulators of different levels; based on the element-wise multiplication operation, the channel attention weights of surface contamination of insulators of different levels and the initial feature map of surface contamination of insulators of different levels are processed to obtain the target feature map of surface contamination of insulators.
[0065] Figure 3 The processing flow of the attention mechanism layer provided in the first embodiment of the present invention is as follows: Figure 3 As shown, the specific process of CAM is as follows: the input insulator surface contamination initial feature map (H×W×C) is subjected to global average pooling to obtain 1×1×C insulator surface contamination channel features. Then it is sent to the multi-layer perceptron. Among them, in the first fully connected layer, the number of channels is scaled to C / r (C is the number of channels, r is the scaling rate). The present invention finally sets r to 4, and the activation function is Relu. The number of channels in the second layer is restored to C. The output features are then sigmoid activated (non-linear activation function), and sigmoid maps the weights to between 0-1. Finally, the weights are multiplied by the insulator surface contamination initial feature map to obtain a new insulator surface contamination feature map, that is, the insulator surface contamination target feature map.
[0066] Table 1 and Table 2 are parameter setting tables of the initial insulator surface contamination level classification model of the present invention, including parameter settings such as batch size, number of iterations, learning rate, convolution kernel, window size, and padding.
[0067] Table 1
[0068] Parameters\Model 2DUNeT-CA Batch size 8 Epoch 300 Learning rate <![CDATA[0.005-1e -6 ]]>
[0069] Table 2
[0070]
[0071]
[0072] In an embodiment of the present invention, Focal Loss can be used to update the parameters of the 2DUNeT-CA model. Focal Loss is a loss function used to solve the problems of class imbalance and difficult and easy samples, and is particularly suitable for target detection and object recognition tasks. It aims to solve the shortcomings of the traditional cross entropy loss function when faced with a large number of easy-to-classify samples. The core idea of Focal Loss is to reduce the weights of easily classified samples in order to pay more attention to difficult-to-classify samples, thereby improving the model's learning ability for difficult samples. It introduces an adjustable attenuation factor to reduce the loss of easy-to-classify samples, thereby reducing their contribution to the overall loss. This adjustment factor makes the model more focused on solving those samples that are easily confused, thereby improving the overall performance of the model. The Focal Loss loss function formula is as follows: FL(p t )=-(1-p t ) γ log(p t ). Among them, pt is the model's predicted probability of the correct category of the sample, and γ is an adjustable hyperparameter used to balance the importance of easy-to-classify samples and difficult-to-classify samples. When γ is large, the loss of easy-to-classify samples will be more effectively reduced, thereby enhancing the model's ability to learn difficult-to-classify samples.
[0073] The closer the predicted value of the model is to the true value, the smaller the value of Focal Loss is. The learning rate of the model in the present invention is 0.005-1e during training. -6 Adam (Adaptive Moment Estimation) optimizer. The Adam optimizer adaptively adjusts the learning rate of each parameter by maintaining the first-order and second-order moments of momentum. Specifically, it calculates the first-order moment (i.e., the mean of the gradient) and the second-order moment (i.e., the mean of the square of the gradient) of the current gradient in each iteration, and uses these moments to update the parameters. By dynamically adjusting the learning rate of each parameter, Adam can achieve better convergence performance under different parameter and gradient conditions.
[0074] S140. Testing the initial insulator surface contamination level classification model based on the test set, and obtaining a target insulator surface contamination level classification model when the test passes.
[0075] In an optional embodiment, the test set includes an insulator surface contamination image and an actual contamination level corresponding to the insulator surface contamination image, and the testing of the initial insulator surface contamination level classification model based on the test set includes: inputting the insulator surface contamination image into the initial insulator surface contamination level classification model to obtain a target contamination level; evaluating the initial insulator contamination level classification model according to preset indicators based on the actual contamination level and the target contamination level; wherein the target contamination level includes at least one of light pollution, moderate pollution and heavy pollution, and the preset indicators include at least one of overall accuracy, average class intersection-over-union ratio and average pixel accuracy.
[0076] Specifically, the test set consists of insulator surface contamination images and their corresponding actual contamination levels. These images and corresponding levels are used to evaluate and optimize the insulator surface contamination level classification model. The insulator surface contamination images are input into the initial insulator surface contamination level classification model, and the model outputs the target contamination level of each image, which may include at least one of light pollution, moderate pollution and heavy pollution. Further, the actual contamination level (i.e., the true label) and the target contamination level (i.e., the predicted label) output by the model are used to evaluate the performance of the model.
[0077] The performance of the model can be evaluated by preset indicators, which may include at least one of overall accuracy, mean intersection over Union (mIoU) and mean pixel accuracy (mPA).
[0078] The overall accuracy can be the ratio of correctly classified samples to the total number of samples. The average class intersection-to-union ratio can be the average of the ratio of the intersection and union of the predicted area and the true area of each category, which is an important indicator for measuring segmentation accuracy. The average pixel accuracy can be the average of the ratio of the number of correctly classified pixels in each category to the total number of pixels in that category.
[0079] In this way, the performance of the insulator surface contamination level classification model can be comprehensively evaluated, including its recognition accuracy and overall performance at different contamination levels. Based on the evaluation results, the model can be further optimized and adjusted to improve its accuracy and reliability in practical applications.
[0080] Among them, the calculation formula for overall accuracy is: Where C(i,i) is the number of correctly predicted pixels of the i-th class in the confusion matrix, and N is the total number of pixels, that is, the total number of pixels of all classes. The calculation formula for the mean class intersection over Union (MIoU) is where p ii is the number of pixels correctly predicted for the i-th class in the confusion matrix; p ij is the number of pixels in the confusion matrix that are actually class i but predicted to be class j; p ji is the number of pixels in the confusion matrix that are actually class j but predicted to be class i. The calculation formula for mean pixel accuracy (MPA) is where p ii is the number of correctly predicted pixels of the i-th class in the confusion matrix; is the total number of pixels that are actually of class i, including all pixels that are correctly predicted and incorrectly predicted.
[0081] The technical solution of this embodiment is to obtain a dataset for the classification of insulator surface contamination levels by collecting and labeling the contamination images on the insulator surface; construct a two-dimensional convolutional U-Net deep learning model with a coupled attention mechanism as an insulator surface contamination level classification model, and use a training set for training; and use a test set to evaluate the accuracy of the model. The present invention combines U-Net and CAM to construct an effective insulator surface contamination level classification model, which has great use value; by introducing CAM, the channel information expression capability is enhanced, thereby improving the application effect. The problems of low efficiency and low accuracy in the classification of insulator surface contamination levels are solved, and efficient insulator surface contamination level classification is achieved by constructing a network model with a coupled attention mechanism.
[0082] Embodiment 2
[0083] Figure 4 This is a flow chart of a method for classifying the pollution level of an insulator surface provided in the second embodiment of the present invention. This embodiment is applicable to the case of classifying the pollution level of an insulator surface. The method can be executed by an insulator surface pollution level classification device, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device. Figure 4 As shown, the method includes:
[0084] S210, obtaining a contaminated image of the surface of the insulator to be identified.
[0085] The contamination image of the insulator surface to be identified may be an image of the insulator surface for which contamination level identification is required. The contamination image of the insulator surface to be identified may be collected by on-site shooting, surveillance cameras, drone inspections, or other image acquisition equipment.
[0086] S220, inputting the contamination image of the insulator surface to be identified into a target insulator surface contamination level classification model to obtain a target insulator surface contamination level classification result corresponding to the contamination image of the insulator surface to be identified.
[0087] The target insulator surface contamination level classification model is obtained by training using the insulator surface contamination level classification model training method in the first embodiment.
[0088] Specifically, the acquired insulator surface contamination image to be identified is input into the trained target insulator surface contamination level classification model. The model processes and analyzes the input image, and then outputs the insulator surface contamination level classification result corresponding to the image.
[0089] Figure 5 A comparison diagram of some insulators provided in the second embodiment of the present invention and their real labels and prediction results, such as Figure 5As shown in the figure: According to the full picture of the 2DUNeT-CA classification results, the insulator surface contamination level classification model can successfully identify the different levels of pollution in the entire image, where yellow is light pollution, red is moderate pollution, and green is heavy pollution. The model classification results solve the real label. It can be found that in the recognition results of the insulator surface contamination level classification model, the distribution of each contaminated area is consistent with the actual situation, indicating that the model proposed in the present invention is feasible.
[0090] Table 3 shows the average accuracy results of the contamination level recognition of all insulator images to be identified based on the insulator surface contamination level classification model.
[0091] Table 3
[0092]
[0093]
[0094] Overall, the OA of 2DUNeT-CA can reach 99.7%, the MIoU can reach 72.6%, and the MPA can reach 81.2%, which is a significant improvement compared to the traditional semantic segmentation method Deeplab based on convolution, and also has a certain improvement compared to Segformer based on attention mechanism.
[0095] The present invention collects the contamination images of the insulator surfaces to be identified; inputs the contamination images of the insulator surfaces to be identified into the target insulator surface contamination level classification model to obtain the insulator surface contamination level classification result, thereby solving the classification problem of the insulator surface contamination level. By constructing 2DUNeT-CA, efficient insulator surface contamination level classification is achieved.
[0096] Embodiment 3
[0097] Figure 6 This is a schematic diagram of the structure of a training device for an insulator surface contamination level classification model provided in the third embodiment of the present invention. Figure 6 As shown, the device comprises:
[0098] The data set generation module 310 is used to collect the contamination images of the insulator surface and mark the contamination images of the insulator surface to obtain the contamination level data set of the insulator surface;
[0099] A data set division module 320, used to divide the insulator surface contamination level data set into a training set and a test set of an insulator surface contamination level classification model;
[0100] A model building training module 330 is used to build a two-dimensional convolutional U-Net deep learning model 2DUNet-CA coupled with an attention mechanism as an initial insulator surface contamination level classification model, and to perform model training on the initial insulator surface contamination level classification model using a training set;
[0101] The initial insulator surface contamination level classification model includes: a convolution layer, an activation function, an upsampling layer, an attention mechanism layer, and a maximum pooling layer;
[0102] The model test evaluation module 340 is used to test the initial insulator surface contamination level classification model based on the test set, and obtain the target insulator surface contamination level classification model when the test passes.
[0103] The training device for the insulator surface contamination level classification model provided in the embodiment of the present invention can execute the training method for the insulator surface contamination level classification model provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0104] Embodiment 4
[0105] Figure 7 A schematic diagram of the structure of an insulator surface contamination level classification device provided in Embodiment 4 of the present invention.
[0106] like Figure 7 As shown, the device comprises:
[0107] The to-be-identified image acquisition module 410 is used to acquire the contaminated image of the surface of the insulator to be identified;
[0108] The classification result determination module 420 is used to input the contamination image of the insulator surface to be identified into the target insulator surface contamination level classification model to obtain the target insulator surface contamination level classification result corresponding to the contamination image of the insulator surface to be identified;
[0109] The target insulator surface contamination level classification model is obtained by training using the insulator surface contamination level classification model training method described in Example 1.
[0110] The insulator surface contamination level classification device provided in the embodiment of the present invention can execute the insulator surface contamination level classification method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0111] Embodiment 5
[0112] Figure 8A schematic diagram of the structure of an electronic device provided for Embodiment 4 of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0113] like Figure 8 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0114] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0115] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as a training method for an insulator surface contamination level classification model or an insulator surface contamination level classification method.
[0116] In some embodiments, the training method of the insulator surface contamination level classification model or the insulator surface contamination level classification method. Can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, the training method of the insulator surface contamination level classification model or the insulator surface contamination level classification method described above can be executed. One or more steps. Alternatively, in other embodiments, the processor 11 can be configured to execute the training method of the insulator surface contamination level classification model or the insulator surface contamination level classification method by any other appropriate means (for example, by means of firmware).
[0117] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0118] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0119] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0120] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0121] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0122] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0123] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0124] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A training method for an insulator surface contamination level classification model, characterized in that: include: Collecting contamination images of the insulator surface, and marking the contamination images of the insulator surface to obtain a contamination level dataset of the insulator surface; Dividing the insulator surface contamination level data set into a training set and a test set of an initial insulator surface contamination level classification model; A two-dimensional convolutional U-Net deep learning model 2DUNet-CA coupled with an attention mechanism is constructed as an initial insulator surface contamination level classification model, and the initial insulator surface contamination level classification model is trained using a training set; The initial insulator surface contamination level classification model includes: a convolution layer, an activation function, an upsampling layer, an attention mechanism layer, and a maximum pooling layer; The initial insulator surface contamination level classification model is tested based on the test set, and when the test passes, a target insulator surface contamination level classification model is obtained.
2. The method according to claim 1, characterized in that: The two-dimensional convolution U-Net deep learning model 2DUNet-CA with coupled attention mechanism is constructed as the initial insulator surface contamination level classification model, including: An encoder and a decoder are constructed for the initial insulator surface contamination level classification model, and the initial insulator surface contamination level classification model is determined based on the encoder and the decoder.
3. The method according to claim 2, characterized in that The encoder for constructing the initial insulator surface contamination level classification model comprises: The convolution layer, the activation function, and the batch normalization processing layer are connected to form an insulator surface contamination level classification convolution module corresponding to the encoder; The two insulator surface contamination level classification convolution modules are connected in series through a maximum pooling layer and repeated three times to form the encoder of the initial insulator surface contamination level classification model.
4. The method according to claim 3, wherein the decoder for constructing the initial insulator surface contamination level classification model comprises: The upsampling, convolutional layers, activation functions, and attention mechanism layers are connected to form a decoder of the insulator surface contamination level classification model; Among them, the attention mechanism layer is composed of a channel attention layer CAM.
5. The method according to claim 3, characterized in that: The processing flow of the attention mechanism layer is as follows: The initial feature map of insulator surface contamination of different levels obtained by the encoding part is averaged and pooled to obtain a 1×1×C CAM intermediate feature map of insulator surface contamination of different levels; C is the number of channels; The intermediate feature map of the insulator surface contamination CAM of different levels is input into a two-layer multi-layer perceptron MLP, and the attention weights of the insulator surface contamination channels of different levels are obtained using an activation function; Based on the element-wise multiplication operation, the attention weights of the insulator surface contamination channels of different levels and the initial feature maps of the insulator surface contamination of different levels are processed to obtain the insulator surface contamination target feature map.
6. The method according to claim 1, wherein the test set includes an insulator surface contamination image and an actual contamination level corresponding to the insulator surface contamination image, and the testing of the initial insulator surface contamination level classification model based on the test set comprises: Inputting the insulator surface contamination image into the initial insulator surface contamination level classification model to obtain a target contamination level; According to the actual pollution level and the target pollution level, evaluating the initial insulator pollution level classification model by using preset indicators; The target pollution level includes at least one of light pollution, moderate pollution and heavy pollution. The preset indicator includes at least one of overall accuracy, average class intersection-over-union ratio and average pixel accuracy.
7. A method for classifying the contamination level of insulator surfaces, characterized in that: include: Obtaining a contaminated image of the surface of the insulator to be identified; Inputting the contamination image of the insulator surface to be identified into a target insulator surface contamination level classification model to obtain a target insulator surface contamination level classification result corresponding to the contamination image of the insulator surface to be identified; The target insulator surface contamination level classification model is obtained by training using the insulator surface contamination level classification model training method described in any one of claims 1 to 6.
8. A training device for an insulator surface contamination level classification model, characterized in that: include: A data set generation module is used to collect the contamination images of the insulator surface and mark the contamination images of the insulator surface to obtain the insulator surface contamination level data set; A data set division module, used for dividing the insulator surface contamination level data set into a training set and a test set of an initial insulator surface contamination level classification model; A model building training module is used to build a two-dimensional convolutional U-Net deep learning model 2DUNet-CA coupled with an attention mechanism as an initial insulator surface contamination level classification model, and the initial insulator surface contamination level classification model is trained using a training set; The initial insulator surface contamination level classification model includes: a convolution layer, an activation function, an upsampling layer, an attention mechanism layer, and a maximum pooling layer; The model test evaluation module is used to test the initial insulator surface contamination level classification model based on the test set, and obtain the target insulator surface contamination level classification model when the test passes.
9. An insulator surface contamination level classification device, characterized in that: include: The module for acquiring the image to be identified is used to acquire the contaminated image on the surface of the insulator to be identified; A classification result determination module is used to input the contamination image of the insulator surface to be identified into a target insulator surface contamination level classification model to obtain a target insulator surface contamination level classification result corresponding to the contamination image of the insulator surface to be identified; The target insulator surface contamination level classification model is obtained by training using the insulator surface contamination level classification model training method described in any one of claims 1 to 6.
10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the training method for the insulator surface contamination level classification model described in any one of claims 1 to 6, or the insulator surface contamination level classification method described in claim 7.
Citation Information
Cited By
Composite insulator state prediction method based on surface resistance-leakage current improved physical model
CN119881563A
Insulator pollution degree classification method based on double-attention multi-scale enhancement network
CN121305231A
Insulator contamination degree classification method based on double-attention multi-scale enhancement network
CN121305231B
