Estimation of the Hydrophobicity of a Composite Insulator Based on an Improved Probabilistic Neural Network

: The estimation of hydrophobicity for composite insulators is of great importance for the purpose of predicting the surface degradation. The hydrophobic image is ﬁrstly decomposed by the 2-level wavelet, along with the multi-Retinex algorithm in this paper. The processed low frequency sub-band and high frequency sub-band images are then reconstructed. The 3 × 3 Sobel operator is performed to measure the basic spatial gradient in four directions, including the horizontal direction, the diagonal direction, and then the vertical direction. The shape factor, the area ratio of the largest water droplet, and the coverage rate of the water droplet are selected as the feature parameters and input into the classiﬁcation network that has been trained to do the hydrophobic level recognition. The effect of the different expansion speed on the desired learning results is discussed. The threshold plays a key role in image processing. Considering that the difference between the water droplet edge and the composite insulator surface is relatively small, the asymptotic semi-soft threshold function is used in pretreatment, whereas the adaptive two-dimensional Otsu’s method is used in image segmentation. The experimental results show that the proposed method has high recognition accuracy up to 94.8% for a diversity of images, and it is superior to the improved Shape Factor Method, the Multi-fractal Method, and the RBF Neural Network.


Introduction
Taking advantage of light weight, shatter-proof performance, the hydrophobic surface, and greater flashover performance under wet and polluted conditions, composite insulators are increasingly popular in the electrical power industry. According to statistics, the amount of composite insulators worldwide had reached 20 million by the end of 2013. Especially, due to the serious air pollution in China, the frequent outdoor insulation flashover has endangered the reliability of power supply. Consequently, the composite insulator is prevailing in ultra-high-voltage alternating current and direct current power transmission [1].
Since the composite insulators are made of polymeric materials, they are degraded by many factors in service, such as the corona discharge, the ultraviolet radiation, etc. The hydrophobicity refers to the capability that causes the water on the insulator surface to form small separated droplets instead of film. It can make it difficult for a conductive channel to form on the surface [2][3][4]. The hydrophobicity sometimes decreases or is even temporarily lost, and it can also transfer to the pollution layer. As a true mapping relations between the hidden layer and the output layer. With the traditional RBF, it is easy to fall into the minimum value in the process of training complex data, and the training time is longer. The probabilistic neural networks (PNNs) [14], as a special RBF, are a feed forward neural network in essence, and the basic idea lies in choosing an optimal decision with the least expectation risk based on the Bayesian minimum risk criterion in the multi-dimensional input space, and uses the linear learning algorithm to achieve the same effect as the nonlinear algorithm. This algorithm is very suitable for pattern recognition and has significant advantages in image classification. Considering the superposition of feature parameters extracted for a composite insulator, an improved PNN is proposed. The results show that the method has high accuracy for a diversity of images and it can meet the requirements for practical application.

Principle of the Probability Density Estimation
In the design of the classifier, the class-conditional probability density is basically unknown. In order to determine the judgment categories according to certain decision rules, it is necessary to collect a certain number of samples. According to statistics theory, the overall probability distribution can be inferred from the probability distribution of the samples, forming the probability density estimation. The objective of the probability density estimate is to find the value of p(t), and the mathematical expression is as follows: where p(t) is the probability density function, F(x) is the probability distribution function, and θ(x) is the step function. The distribution function F(x) can be constructed via samples x 1~xl : The probability density function satisfies: Presently, the probability density estimation methods are mainly divided into two categories: non-parametric estimation and parametric estimation. Given the class that the sample belongs to, the former uses the training data to infer the probability density function. The latter determines the parameter values in the expression through parametrical estimation, thereby obtaining the density function. The Bayesian Estimation is the most commonly used one in parametrical estimation. Since the sample data are often limited and the class-conditional probability density is basically unknown, in practice, we need to first estimate it, and then use Bayesian classification rules to classify. The Bayesian classification rule is the minimum expected risk to achieve a decision based on the size of the posterior probability. It is assumed that the category is represented by an n-dimensional vector X = [x 1 , x 2 , L . . . x n ]. For θ 1 , θ 2 , θ p . . . θ s categories with multiple parameters, the state of θ∈θ p can be determined based on the eigenvector X. The objective function is described as follows: d(X) ∈ θ p , h p l p f p (X) > h k l k f k (X), k = p (5) 2σ 2 (6) where h p and h k indicate the prior class probability. f p (X) and f k (X) are the probability density coefficients of θ p and θ k , respectively. d(X) is vector decision. l p is the loss function of θ p misclassified as other classes. l k is the loss function of θ k misclassified as other classes. N p is the number of θ p samples.
σ is a smoothing parameter, n is a vector dimension, and X pi is the ith small sample in a θ p class sample. In theory, this Bayesian classification has a small error rate.

Structure of Probabilistic Neural Network
The hydrophobicity of composite insulators is classified into seven categories in industry. The structure of PNN for hydrophobicity estimation is shown in Figure 1. It consists of four layers, including the input layer, the pattern layer, the summation layer, and the output layer. Its main functions are as follows: (1) Input layer: since each sample has three features, the input layer will have three neurons. The difference between the input vectors → x and the learning sample vector → x ik is calculated at the input layer, and then the resulting vector difference → x − → x ik is fed into the pattern layer. The vector difference reflects the closeness between the two vectors. The absolute value is equal to the Euclidean distance between the two vectors.
(2) Pattern layer: there are as many neurons as there are learning samples. In this paper, 20 pairs of composite insulators are selected as samples. Each sample has three features. There are 140 learning samples in total. That means the pattern layer has 140 neurons. The model layer first determines which classes of insulators are related to the input vector, and then it concentrates the classes with higher correlation. Finally, the acquaintances of each category are sent to the summation layer.
(3) Summation layer: the number of neurons in this layer is equal to the number of categories. Each neuron corresponds to a category, which is determined by calculating the degree of acquaintance through a competitive transfer function.
(4) Output layer: the output layer is used to yield the decision. The output result with the largest probability value is 1 and the rest of the outputs are 0. Selecting 1 corresponds to categories in the output value as the recognition results; we can obtain the hydrophobicity that the composite insulator belongs to. where hp and hk indicate the prior class probability. fp(X) and fk(X) are the probability density coefficients of θp and θk, respectively. d(X) is vector decision. lp is the loss function of θp misclassified as other classes. lk is the loss function of θk misclassified as other classes. Np is the number of θp samples. σ is a smoothing parameter, n is a vector dimension, and Xpi is the ith small sample in a θp class sample. In theory, this Bayesian classification has a small error rate.

Structure of Probabilistic Neural Network
The hydrophobicity of composite insulators is classified into seven categories in industry. The structure of PNN for hydrophobicity estimation is shown in Figure 1. It consists of four layers, including the input layer, the pattern layer, the summation layer, and the output layer. Its main functions are as follows: (1) Input layer: since each sample has three features, the input layer will have three neurons. The difference between the input vectors x  and the learning sample vector i k x  is calculated at the input layer, and then the resulting vector difference is fed into the pattern layer. The vector difference reflects the closeness between the two vectors. The absolute value is equal to the Euclidean distance between the two vectors.
(2) Pattern layer: there are as many neurons as there are learning samples. In this paper, 20 pairs of composite insulators are selected as samples. Each sample has three features. There are 140 learning samples in total. That means the pattern layer has 140 neurons. The model layer first determines which classes of insulators are related to the input vector, and then it concentrates the classes with higher correlation. Finally, the acquaintances of each category are sent to the summation layer.
(3) Summation layer: the number of neurons in this layer is equal to the number of categories. Each neuron corresponds to a category, which is determined by calculating the degree of acquaintance through a competitive transfer function.
(4) Output layer: the output layer is used to yield the decision. The output result with the largest probability value is 1 and the rest of the outputs are 0. Selecting 1 corresponds to categories in the output value as the recognition results; we can obtain the hydrophobicity that the composite insulator belongs to. The weights from the pattern layer to the summation layer and the summing layer to the output layer are all 1.0. The weights from the input layer to the pattern layer can be calculated, and the learning process is relatively simple without the convergence problem. Since the input layer and the summation layer can be determined according to the actual situation before learning, it is only necessary to determine the number of learning samples so as to determine the structure of the PNN. The weights from the pattern layer to the summation layer and the summing layer to the output layer are all 1.0. The weights from the input layer to the pattern layer can be calculated, and the learning process is relatively simple without the convergence problem. Since the input layer and the summation layer can be determined according to the actual situation before learning, it is only necessary to determine the number of learning samples so as to determine the structure of the PNN.

Hydrophobicity Image Processing
The image processing for hydrophobicity identification includes three parts: pretreatment, segmentation, and classification.

Image Pretreatment
An image is often corrupted by noise in acquisition. To improve the image quality, the wavelet transform method, which has good localized characteristics, and can represent the structure and texture of image at different resolution levels, is used to denoise the image. Assuming that: where g(i, j) represents the observed image, f (i, j) represents the original one, and n(i, j) represents noise. The signal is decomposed in a separable model and filtering and decimation processing are performed in the row and column directions individually. The noise-free image is W g = W f + W n after transformation. Here, W g is the wavelet coefficient of the observed image, W f is the wavelet coefficient of the original one, and W n is the wavelet coefficient of noise. The original image f (i, j) is decomposed by the two-dimensional wavelet. Then, four sub-signals are obtained, i.e., LL1, LH1, HL1 and HH1. They represent sub-signals of a low frequency, horizontal high frequency, vertical high frequency, and diagonal high frequency on a scale of 2, respectively. Further, LL can be decomposed into a low-frequency component and three high-frequency components. Generally, the low-frequency region corresponds to the basic contour, whereas the high-frequency region reflects the details of the noise. The high-frequency information is subject to threshold filtering. The threshold is mainly divided into two types: hard threshold and soft threshold. Both of them can preserve the edge detail information and smooth the image. However, there are some defects. The former has no continuity, which often causes Gibbs ringing; the latter can make the image blur and easily give rise to distortions. In this work, an asymptotic semi-soft threshold function is employed. The formula is expressed in Equation (8): If the main component of wavelet coefficient is larger than the threshold ε, it is a useful signal; otherwise, it is set to 0 and the pixel value is supposed as the noise. Here, the term 2ε 1+e |ω j,k |−ε is used to adaptively estimate the threshold to make the value continuously approach the true wavelet coefficient. The function is continuous at the threshold ε, and it can avoid a constant difference. The results are depicted in Figure 2. Clearly, the noise is effectively suppressed and the water droplets become more prominent. The running time is 0.18241 s only on a 2.40 GHz Intel Core i5-4258U CPU-based personal computer, and it is computationally efficient.

Hydrophobicity Image Processing
The image processing for hydrophobicity identification includes three parts: pretreatment, segmentation, and classification.

Image Pretreatment
An image is often corrupted by noise in acquisition. To improve the image quality, the wavelet transform method, which has good localized characteristics, and can represent the structure and texture of image at different resolution levels, is used to denoise the image. Assuming that: where g(i, j) represents the observed image, f(i, j) represents the original one, and n(i, j) represents noise. The signal is decomposed in a separable model and filtering and decimation processing are performed in the row and column directions individually. The noise-free image is Wg = Wf + Wn after transformation. Here, Wg is the wavelet coefficient of the observed image, Wf is the wavelet coefficient of the original one, and Wn is the wavelet coefficient of noise. The original image f(i, j) is decomposed by the two-dimensional wavelet. Then, four sub-signals are obtained, i.e., LL1, LH1, HL1 and HH1. They represent sub-signals of a low frequency, horizontal high frequency, vertical high frequency, and diagonal high frequency on a scale of 2, respectively. Further, LL can be decomposed into a low-frequency component and three high-frequency components. Generally, the low-frequency region corresponds to the basic contour, whereas the high-frequency region reflects the details of the noise. The high-frequency information is subject to threshold filtering. The threshold is mainly divided into two types: hard threshold and soft threshold. Both of them can preserve the edge detail information and smooth the image. However, there are some defects. The former has no continuity, which often causes Gibbs ringing; the latter can make the image blur and easily give rise to distortions. In this work, an asymptotic semi-soft threshold function is employed. The formula is expressed in Equation (8): If the main component of wavelet coefficient is larger than the threshold ε, it is a useful signal; otherwise, it is set to 0 and the pixel value is supposed as the noise. Here, the term e k j      , 1 2 is used to adaptively estimate the threshold to make the value continuously approach the true wavelet coefficient. The function is continuous at the threshold ε, and it can avoid a constant difference. The results are depicted in Figure 2. Clearly, the noise is effectively suppressed and the water droplets become more prominent. The running time is 0.18241 s only on a 2.40 GHz Intel Core i5-4258U CPU-based personal computer, and it is computationally efficient.  To make the region of interest become clearer, and to weaken or even delete the useless regions, the Retinex theory is used to enhance the contrast. This theory mainly follows the color constancy mechanism, and achieves its purpose by changing the ratio of the illumination component to the reflection component. According to the theory, an image can be divided into an incident light and a reflecting object: S(x, y) = L(x, y)·R(x, y) where S(x, y) is the observed image, L(x, y) represents the incident light, which mainly contains the low-frequency component and determines the dynamic range of the image pixel; R(x, y) corresponds to the reflecting object, which describes the high-frequency information and maps the essential details of the object. The expression of multi-Retinex function is: And: where F k represents the kth surrounding function, ω k is the weight coefficient associated with F k , N is the scale number, and τ k is the kth scale parameter. A 3-scale Retinex enhancement was performed on the low frequency approximation coefficient in this work. The scale parameters τ k were 20, 80, and 200, respectively, and the weight ω k is 1/3. The image after such operation is given in Figure 3. The water droplet become more prominent and the histogram are relatively balanced. To make the region of interest become clearer, and to weaken or even delete the useless regions, the Retinex theory is used to enhance the contrast. This theory mainly follows the color constancy mechanism, and achieves its purpose by changing the ratio of the illumination component to the reflection component. According to the theory, an image can be divided into an incident light and a reflecting object: where S(x, y) is the observed image, L(x, y) represents the incident light, which mainly contains the low-frequency component and determines the dynamic range of the image pixel; R(x, y) corresponds to the reflecting object, which describes the high-frequency information and maps the essential details of the object. The expression of multi-Retinex function is: And: where Fk represents the kth surrounding function, ωk is the weight coefficient associated with Fk, N is the scale number, and τk is the kth scale parameter. A 3-scale Retinex enhancement was performed on the low frequency approximation coefficient in this work. The scale parameters τk were 20, 80, and 200, respectively, and the weight ωk is 1/3. The image after such operation is given in Figure 3.
The water droplet become more prominent and the histogram are relatively balanced.  The block diagram of the entire pretreatment for the hydrophobic image is shown in Figure 4. After a 2-level wavelet decomposition and a 3-scale Retinex enhancement [15], the processed low-frequency sub-band and high frequency sub-band images are finally reconstructed and output. The block diagram of the entire pretreatment for the hydrophobic image is shown in Figure 4. After a 2-level wavelet decomposition and a 3-scale Retinex enhancement [15], the processed low-frequency sub-band and high frequency sub-band images are finally reconstructed and output.  To further confirm the performance of the proposed method, a Gaussian noise is added to the original image, and the results are shown in Figure 5. To quantitatively evaluate the image enhancement performance, three indexes, i.e., the information entropy, the contrast, and the signal-to-noise ratio, were introduced. Their expressions are as follows: The information entropy: The contrast: The signal-to-noise ratio: where σ is the standard deviation, σ 2 is the variance, and μ is the mean of the grayscale value. Table 1 gives the index of the images after pretreatment. To further confirm the performance of the proposed method, a Gaussian noise is added to the original image, and the results are shown in Figure 5.  To further confirm the performance of the proposed method, a Gaussian noise is added to the original image, and the results are shown in Figure 5. To quantitatively evaluate the image enhancement performance, three indexes, i.e., the information entropy, the contrast, and the signal-to-noise ratio, were introduced. Their expressions are as follows: The information entropy: The contrast: The signal-to-noise ratio: where σ is the standard deviation, σ 2 is the variance, and μ is the mean of the grayscale value. Table 1 gives the index of the images after pretreatment. To quantitatively evaluate the image enhancement performance, three indexes, i.e., the information entropy, the contrast, and the signal-to-noise ratio, were introduced. Their expressions are as follows: The information entropy: The contrast: The signal-to-noise ratio: where σ is the standard deviation, σ 2 is the variance, and µ is the mean of the grayscale value. Table 1 gives the index of the images after pretreatment. The information entropy is a measure to eliminate uncertainty, and it is also the average amount of information on the grayscale pixels. The larger the entropy, the more edge details are preserved. The contrast is the visual property of an object separated from others. The higher the local contrast, the greater the brightness differences between the target and the background. The signal-to-noise ratio compares the desired signal to the noise power. A high signal-to-noise ratio value means a better noise suppression. Clearly, the combination of wavelet denoising and 3-scale Retinex enhancements can filter out the noise and enhance local contrast, and the image quality has been greatly improved in the aforementioned three aspects, and the grayscale is redistributed. The effect of preprocessing makes the subsequent feature extraction results more accurate.

Image Segmentation
Taking advantages of the simplicity, the Sobel operator is performed to measure the basic spatial gradient and orientation of the image, as given in Equation (8). Instead of the 2 × 2 neighborhood, the gradient in four directions, including the horizontal direction (0 • ), the diagonal direction (45 • and 135 • ), and then vertical direction (90 • ), is computed individually [16]. The 3 × 3 neighboring areas of the pixel are all considered. The sub-masks of the operator are shown in Figure 6. Here, the numbers in the mask represent the weighted average for the convolution.  The information entropy is a measure to eliminate uncertainty, and it is also the average amount of information on the grayscale pixels. The larger the entropy, the more edge details are preserved. The contrast is the visual property of an object separated from others. The higher the local contrast, the greater the brightness differences between the target and the background. The signal-to-noise ratio compares the desired signal to the noise power. A high signal-to-noise ratio value means a better noise suppression. Clearly, the combination of wavelet denoising and 3-scale Retinex enhancements can filter out the noise and enhance local contrast, and the image quality has been greatly improved in the aforementioned three aspects, and the grayscale is redistributed. The effect of preprocessing makes the subsequent feature extraction results more accurate.

Image Segmentation
Taking advantages of the simplicity, the Sobel operator is performed to measure the basic spatial gradient and orientation of the image, as given in Equation (8). Instead of the 2 × 2 neighborhood, the gradient in four directions, including the horizontal direction (0°), the diagonal direction (45° and 135°), and then vertical direction (90°), is computed individually [16]. The 3 × 3 neighboring areas of the pixel are all considered. The sub-masks of the operator are shown in Figure  6. Here, the numbers in the mask represent the weighted average for the convolution. The four components are then combined into a matrix, and the norm is computed. The final gradient magnitude of the pixel, denoted by M(x, y), is obtained: The threshold is a critical step in the image segmentation. Considering that the difference between the water droplet edge and the composite insulator surface is relatively small, the one-dimensional Otsu's method is difficult to accurately distinguish the target and the background. To address this issue, an adaptive two-dimensional maximum inter-class variance is employed in this paper. Suppose that the gray level of the image is L, and that the pixels are partitioned into four classes, i.e., C0, C1, C2, and C3 by a threshold pair (s, t), as shown in Figure 7, where the subscripts 0, 1, 2, and 3 represent the background, the object, the edge region, and the noise region, respectively. The four components are then combined into a matrix, and the norm is computed. The final gradient magnitude of the pixel, denoted by M(x, y), is obtained: M(x, y) = ||G(x, y)|| The threshold is a critical step in the image segmentation. Considering that the difference between the water droplet edge and the composite insulator surface is relatively small, the one-dimensional Otsu's method is difficult to accurately distinguish the target and the background. To address this issue, an adaptive two-dimensional maximum inter-class variance is employed in this paper. Suppose that the gray level of the image is L, and that the pixels are partitioned into four classes, i.e., C 0 , C 1 , C 2 , and C 3 by a threshold pair (s, t), as shown in Figure 7, where the subscripts 0, 1, 2, and 3 represent the background, the object, the edge region, and the noise region, respectively. According to the homomorphism of the target and the background, the probability density pi, j will be concentrated near the diagonal lines (the dotted line) in Figure 7. The two-dimensional threshold of the hydrophobic image can be obtained by calculating the inter-class variance of the target region C0 and the background region C1 [17]. Mathematically, the probability distribution of object and background: The mean grayscale value of the object and background: The mean grayscale value of the entire image: The optimal threshold (s, t) is selected by maximizing the inter-class variance between C0 and C1: The proposed method is compared with the traditional Canny operator, as shown in Table 2. According to the homomorphism of the target and the background, the probability density p i, j will be concentrated near the diagonal lines (the dotted line) in Figure 7. The two-dimensional threshold of the hydrophobic image can be obtained by calculating the inter-class variance of the target region C 0 and the background region C 1 [17]. Mathematically, the probability distribution of object and background: The mean grayscale value of the object and background: The mean grayscale value of the entire image: The optimal threshold (s, t) is selected by maximizing the inter-class variance between C 0 and C 1 : The proposed method is compared with the traditional Canny operator, as shown in Table 2.

HC7
It can be seen that for HC1-C3, the traditional algorithm can roughly recognize the edge contour of the water droplets and distinguish the details. With an increase in the water repellency grade, the effect is gradually deteriorated. For HC6-HC7, it cannot distinguish the target and the background, and there is a case that the background is wrongly identified into the target. The Canny operator is only applicable to the low-level hydrophobicity image analysis. On the other hand, the proposed algorithm can detect more real edges and achieve accurate image segmentation by means of improving the gradient and the threshold. The number of broken lines generated during the segmentation process is significantly reduced.
Since the water droplets on composite insulator have a strong reflection to light, some white small holes may occur, and the contour is not conducive to the capture of the true profile. In this work, the morphological filling is also performed. The disk structure element with a radius of 2 is selected to perform an expansion operation, and then the structural elements are used to fill the water droplet contour. The structural elements of the disc radius of 1 are used for a corrosion operation. Such operations can effectively fill a single-pixel hole and clear isolated foreground pixels. The results are given in Figure 8. In Figure 8a-e, the white area indicates the water droplet, whereas the black area indicates the background. On the contrary, in Figure 8f,g, the black area indicates the water film, whereas the It can be seen that for HC1-C3, the traditional algorithm can roughly recognize the edge contour of the water droplets and distinguish the details. With an increase in the water repellency grade, the effect is gradually deteriorated. For HC6-HC7, it cannot distinguish the target and the background, and there is a case that the background is wrongly identified into the target. The Canny operator is only applicable to the low-level hydrophobicity image analysis. On the other hand, the proposed algorithm can detect more real edges and achieve accurate image segmentation by means of improving the gradient and the threshold. The number of broken lines generated during the segmentation process is significantly reduced.
Since the water droplets on composite insulator have a strong reflection to light, some white small holes may occur, and the contour is not conducive to the capture of the true profile. In this work, the morphological filling is also performed. The disk structure element with a radius of 2 is selected to perform an expansion operation, and then the structural elements are used to fill the water droplet contour. The structural elements of the disc radius of 1 are used for a corrosion operation. Such operations can effectively fill a single-pixel hole and clear isolated foreground pixels. The results are given in Figure 8. In Figure 8a-e, the white area indicates the water droplet, whereas the black area indicates the background. On the contrary, in Figure 8f,g, the black area indicates the water film, whereas the It can be seen that for HC1-C3, the traditional algorithm can roughly recognize the edge contour of the water droplets and distinguish the details. With an increase in the water repellency grade, the effect is gradually deteriorated. For HC6-HC7, it cannot distinguish the target and the background, and there is a case that the background is wrongly identified into the target. The Canny operator is only applicable to the low-level hydrophobicity image analysis. On the other hand, the proposed algorithm can detect more real edges and achieve accurate image segmentation by means of improving the gradient and the threshold. The number of broken lines generated during the segmentation process is significantly reduced.
Since the water droplets on composite insulator have a strong reflection to light, some white small holes may occur, and the contour is not conducive to the capture of the true profile. In this work, the morphological filling is also performed. The disk structure element with a radius of 2 is selected to perform an expansion operation, and then the structural elements are used to fill the water droplet contour. The structural elements of the disc radius of 1 are used for a corrosion operation. Such operations can effectively fill a single-pixel hole and clear isolated foreground pixels. The results are given in Figure 8. In Figure 8a-e, the white area indicates the water droplet, whereas the black area indicates the background. On the contrary, in Figure 8f,g, the black area indicates the water film, whereas the It can be seen that for HC1-C3, the traditional algorithm can roughly recognize the edge contour of the water droplets and distinguish the details. With an increase in the water repellency grade, the effect is gradually deteriorated. For HC6-HC7, it cannot distinguish the target and the background, and there is a case that the background is wrongly identified into the target. The Canny operator is only applicable to the low-level hydrophobicity image analysis. On the other hand, the proposed algorithm can detect more real edges and achieve accurate image segmentation by means of improving the gradient and the threshold. The number of broken lines generated during the segmentation process is significantly reduced.
Since the water droplets on composite insulator have a strong reflection to light, some white small holes may occur, and the contour is not conducive to the capture of the true profile. In this work, the morphological filling is also performed. The disk structure element with a radius of 2 is selected to perform an expansion operation, and then the structural elements are used to fill the water droplet contour. The structural elements of the disc radius of 1 are used for a corrosion operation. Such operations can effectively fill a single-pixel hole and clear isolated foreground pixels. The results are given in Figure 8. It can be seen that for HC1-C3, the traditional algorithm can roughly recognize the edge contour of the water droplets and distinguish the details. With an increase in the water repellency grade, the effect is gradually deteriorated. For HC6-HC7, it cannot distinguish the target and the background, and there is a case that the background is wrongly identified into the target. The Canny operator is only applicable to the low-level hydrophobicity image analysis. On the other hand, the proposed algorithm can detect more real edges and achieve accurate image segmentation by means of improving the gradient and the threshold. The number of broken lines generated during the segmentation process is significantly reduced.
Since the water droplets on composite insulator have a strong reflection to light, some white small holes may occur, and the contour is not conducive to the capture of the true profile. In this work, the morphological filling is also performed. The disk structure element with a radius of 2 is selected to perform an expansion operation, and then the structural elements are used to fill the water droplet contour. The structural elements of the disc radius of 1 are used for a corrosion operation. Such operations can effectively fill a single-pixel hole and clear isolated foreground pixels. The results are given in Figure 8. In Figure 8a-e, the white area indicates the water droplet, whereas the black area indicates the background. On the contrary, in Figure 8f,g, the black area indicates the water film, whereas the In Figure 8a-e, the white area indicates the water droplet, whereas the black area indicates the background. On the contrary, in Figure 8f,g, the black area indicates the water film, whereas the white area indicates the background. For HC1-HC3, the water droplets are distributed uniformly, and the water droplets are scattered, which makes it easier to extract characteristic parameters. For HC4-HC5, the presence of accumulated contamination on the shed surface would inevitably complicate the segmentation process and affect the morphological filling correction to some extent. For HC6-HC7, the surface is almost completely covered by the water film. The white area in the filled image represents the background. The whole image needs to be analyzed in combination with the number of white areas to distinguish HC1-HC5 white area. The results showed that the contour of the water-repellent image treated by the morphological algorithm was more round and smooth, and the shape of the water droplet itself was well matched. Some closed small holes existing in the segmented image were effectively removed, which lays a basis for the subsequent feature extraction.

Feature Extraction
The improved shape factor is a common method for extracting the hydrophobic characteristics of composite insulators. It combines the shape factor and the area of the largest water droplet, which greatly enhance the judgment accuracy. In this work, three feature parameters were selected: Here, f c , S max , l, and K represent the shape factor, the area, the perimeter, and the area ratio of the largest water droplet, respectively. M and N are the length and width of the image, respectively; V represents the coverage rate of water droplets. N a is the amount of water droplets identified, and S i is the area of the ith water droplet.

Hydrophobicity Classification
The flowchart of the hydrophobicity classification is shown in Figure 9.
Step 1: Determine the input layer of PNN, i.e., there are n neurons and p insulator samples to be tested. Because each insulator has three characteristic parameters, according to the actual situation, n is 3, and p is 7. Then normalize the input vector matrix.
Step 2: Determine the pattern layer of PNN, the number of neurons that are equal to the number of learning samples m; this article selects seven types of insulators, and each type of the 20 samples as a learning sample, so that m = 140. The learning samples are numbered sequentially according to the category, then the neurons numbered 1-20 are the first type, the neurons numbered 21-40 are the second type, and so on. The neurons numbered 121-140 are designated as Type 7 patterns; each summation unit only connects to the corresponding pattern layer neuron. The m learning samples are organized into a matrix according to their respective characteristic parameters. In order to reduce the error, facilitate subsequent data processing, and speed up the convergence speed of the algorithm, the sample matrix is normalized.
Step 3: Calculate the Euclidean Distance of the corresponding elements in the normalized matrix of the sample matrix to be tested, and the learning sample.
Step 4: Take a Gaussian-type function with a standard deviation of 0.1, and obtain the initial probability matrix by activating the radial basis neurons in the pattern layer.
Step 5: From the foregoing, we know that m = 140 and c = 7. A total of 140 learning samples are then divided into seven categories and 20 samples in each category. To facilitate the counting, let k be the number of learning samples per sample; that is, k = 20. The sum of the initial probability that 140 samples belong to each class can be solved at the summation level of the network.
Step 6: Solve the probability prob ij that the ith sample to be identified belongs to the jth class, and find out the maximum probability of each row to find the category of each sample to be identified.
Energies 2018, 11, x FOR PEER REVIEW 13 of 20 Step 6: Solve the probability probij that the ith sample to be identified belongs to the jth class, and find out the maximum probability of each row to find the category of each sample to be identified. The PNN first calculates the distance between the input variable and the training sample vector through the radial basis of the pattern layer, and then the summing layer calculates the probability of the occurrence of each mode according to the distance vector. The output layer finally outputs the element with the highest probability in the transfer function as 1, and takes this output as water repellency; otherwise, the output 0 is taken as other class categories.

Results & Discussion
In this work, 20 sets of water-sprayed composite insulator images are selected from a database library. Each set has seven hydrophobic images with different grades. Two typical sets are shown in Figure A1. They are selected as training samples, and the inputs are input into a PNN to train the network. The detailed feature parameters are listed in Table 3.  The PNN first calculates the distance between the input variable and the training sample vector through the radial basis of the pattern layer, and then the summing layer calculates the probability of the occurrence of each mode according to the distance vector. The output layer finally outputs the element with the highest probability in the transfer function as 1, and takes this output as water repellency; otherwise, the output 0 is taken as other class categories.

Results & Discussion
In this work, 20 sets of water-sprayed composite insulator images are selected from a database library. Each set has seven hydrophobic images with different grades. Two typical sets are shown in Figure A1. They are selected as training samples, and the inputs are input into a PNN to train the network. The detailed feature parameters are listed in Table 3. The network training frequency is set to 1000, the training goal is 0.01, and the initial learning rate is 0.1. In the PNN network training, the expansion speed is usually set to 1.0. The error curve of training is plotted in Figure 10. Due to the large amount of input data and the small difference between the individual feature parameters, the neural network reaches the optimum when the training number reaches 329 times. The network training frequency is set to 1000, the training goal is 0.01, and the initial learning rate is 0.1. In the PNN network training, the expansion speed is usually set to 1.0. The error curve of training is plotted in Figure 10. Due to the large amount of input data and the small difference between the individual feature parameters, the neural network reaches the optimum when the training number reaches 329 times. Since the maximum area ratio of the HC1-HC3 insulators is relatively small, the range value is only 0-10%; while the maximum area ratio of HC4-HC5 insulators fluctuates greatly, reaching 10-80%. In order to make some radial basis nerves to respond better to the input vector and the training result closer to the expected result the spread rate is set to 1.0, 0.8, 0.5, 0.2, and 0.1, respectively. The training error is shown in Table 4. We can see that the error is mainly on the image of HC2. With the gradual reduction in the expansion speed, the number of errors in HC2 has dropped significantly, and the error rate reaches a minimum value when Spread = 0.2. Since the expansion speed does not affect the expected learning results of HC4-HC7 images, for the convenience, the network training effect diagram of HC1-HC3 insulators is selected, as shown in Figure A2. By comparing the training sample classification results, it can be seen that with the decrease of Spread, the error between the classification result and the expected result gradually decreases. When Spread is equal to 0.2, the classification result is the best. As Spread continues to decrease, the error between the classification result and the expected result gradually increases. Therefore, in this paper, the Spread rate is set to 0.2 for the training of the PNN. The trained effect is shown in Figure 11. Since the maximum area ratio of the HC1-HC3 insulators is relatively small, the range value is only 0-10%; while the maximum area ratio of HC4-HC5 insulators fluctuates greatly, reaching 10-80%. In order to make some radial basis nerves to respond better to the input vector and the training result closer to the expected result the spread rate is set to 1.0, 0.8, 0.5, 0.2, and 0.1, respectively. The training error is shown in Table 4. We can see that the error is mainly on the image of HC2. With the gradual reduction in the expansion speed, the number of errors in HC2 has dropped significantly, and the error rate reaches a minimum value when Spread = 0.2. Since the expansion speed does not affect the expected learning results of HC4-HC7 images, for the convenience, the network training effect diagram of HC1-HC3 insulators is selected, as shown in Figure A2. By comparing the training sample classification results, it can be seen that with the decrease of Spread, the error between the classification result and the expected result gradually decreases. When Spread is equal to 0.2, the classification result is the best. As Spread continues to decrease, the error between the classification result and the expected result gradually increases. Therefore, in this paper, the Spread rate is set to 0.2 for the training of the PNN. The trained effect is shown in Figure 11. After the training of PNN, 30 sets of samples are tested (seven hydrophobic images in each group), and a total of 210 sets of data are input after normalizing the data. The water-repellency grades of composite insulators to be tested in this network are used to classify in the already trained network, and some of the prediction effects are shown in Figure 12. The classification of the normalized feature parameters was performed using an Improved Shape Factor method, the Multi-fractal-based classification method, and an RBF Neural Network. The recognition results with different methods are compared and listed in Table 5.   After the training of PNN, 30 sets of samples are tested (seven hydrophobic images in each group), and a total of 210 sets of data are input after normalizing the data. The water-repellency grades of composite insulators to be tested in this network are used to classify in the already trained network, and some of the prediction effects are shown in Figure 12. The classification of the normalized feature parameters was performed using an Improved Shape Factor method, the Multi-fractal-based classification method, and an RBF Neural Network. The recognition results with different methods are compared and listed in Table 5.  After the training of PNN, 30 sets of samples are tested (seven hydrophobic images in each group), and a total of 210 sets of data are input after normalizing the data. The water-repellency grades of composite insulators to be tested in this network are used to classify in the already trained network, and some of the prediction effects are shown in Figure 12. The classification of the normalized feature parameters was performed using an Improved Shape Factor method, the Multi-fractal-based classification method, and an RBF Neural Network. The recognition results with different methods are compared and listed in Table 5.   While using the improved Shape Factor Method, the HC1-HC3 image had a high accuracy due to the uniform shape of water droplets and clear edge contours. As the level of hydrophobicity increases, the insulator sheds are gradually covered by water film, and the detection accuracy is degraded. Regarding the Multi-fractal Method, the hydrophobicity recognition rate of HC6 ≥ HC7 is relatively higher. If the hydrophobicity grade is divided into three categories, the classification accuracy rate can reach up to 90%-100%. The RBF Neural Network had a good detection results, and the misjudgment mostly occurs in adjacent grades. Using the algorithm, the segmentation of water-repellent images could improve the recognition rate of hydrophobic grades before the determination based on the PNN, and its processing effect was very good. The total accurate recognition rate was up to 94.8%. For HC1-HC3, the difference between water droplets was small, especially the fluctuation of the maximum area ratio parameter, which could easily lead to errors in the training network. Therefore, the detection accuracy was relatively low. The main reason for this was that the characteristic parameters of HC2 were similar to those of HC1 and HC3, and it was easily misjudged as HC1 or HC3. With the improvement of hydrophobicity, the detection accuracy was improved. For HC1 and HC3, the detection accuracy rate also slightly decreased, due to individual errors in the training network. Since the misjudgment of this network mainly occurred between adjacent levels, in practice, the water-repelling level of the suspended network was not a certain level in the strict sense. In practice, the judgment accuracy of hydrophobicity can be close to 100%.

Conclusions
The hydrophobicity of composite insulator is estimated in detail in this work, and the conclusions are drawn as follows:

•
The combination of the 2-level wavelet denoising and the 3-scale Retinex enhancements not only filters out the noise, but it also enhances the local contrast. The image quality has been greatly improved in the information entropy, the contrast, and the signal-to-noise ratio. The use of an asymptotic semi-soft threshold function preserves the edge detail information and avoids a constant difference in the threshold; the two-dimensional adaptive Otsu's method is demonstrated to be effective in segmentation for addressing the small difference between the water droplet edge and the composite insulator surface.

•
The shape factor, the area ratio of the largest water droplet, and the coverage rate of the water droplet are selected as the feature parameters, and they are input into the improved PNN. The effect of the expansion speed on the learning network is compared and analyzed. The experimental results show that the proposed method is suitable for the superposition of feature parameters, and has a high recognition accuracy of up to 94.8% for a diversity of images. It is superior to the Improved Shape Factor Method, the Multifractal Method, and the RBF Neural Network.

•
The proposed method can be applied to the area of image-based pattern recognition. It can be used for remote sensing image analysis, robot vision, image-based biometric verification, and so on.