Anomaly Detection, Trend Evolution, and Feature Extraction in Partial Discharge Patterns

In the resilient and reliable electrical power system, the condition of high voltage insulation plays a crucial role. In the field of high voltage insulation integrity, the partial discharge (PD) inception and development trends are essential for assessment criteria in diagnostics systems. The observed trend to employ more and more sophisticated algorithms with machine learning features and artificial intelligence (AI) elements is observed everywhere. The classification and identification of features in PD images is perceived as a critical requirement for an effective high voltage insulation diagnosis. In this context, techniques allowing for anomaly detection, trends observation, and feature extraction in partial discharge patterns are important. In this paper, the application of few algorithms belonging to image processing, machine learning and optical flow is presented. The feature extraction refers to image segmentation and detection of coherent forms in the images. The anomaly detection algorithms can trigger early detection of the trend changes or the appearance of a new discharge form, and hence are suitable for PD monitoring applications. Anomaly detection can also handle transients and disturbances that appear in the PD image as an indication of an abnormal state. The future monitoring systems should be equipped with trend evolution algorithms. In this context, two examples of insulation aging and application of PD-based monitoring are shown. The first one refers to deep convolutional neural networks used for classification of deterioration stages in high voltage insulation. The latter one demonstrates application of optical flow approach for motion detection in partial discharge images. The motivation for the research was the strive to machine-controlled pattern analysis, leading towards intelligent PD-based diagnostics.


Introduction
In the resilient and reliable electrical power system, the condition of high voltage (HV) insulation plays a crucial role. This refers to various objects in power grids and the types of insulating medium, i.e., gaseous, solid, and liquid dielectrics. The architecture of a complex asset management system is based usually on past, historical data, lifetime models, as well as on the monitoring data obtained from real-time connectivity. The observed trend to employ more and more sophisticated algorithms with machine learning features and artificial intelligence (AI) elements is observed everywhere. The reasoning foundation will rely mostly on several weighted key indicators reflecting the condition of analyzed objects and systems. In the field of high voltage insulation integrity, the partial discharge (PD) inception and development trends are essential for the assessment criteria in diagnostics systems. Partial discharges refer to the phenomena where there is no direct insulation breakdown, but rather gradual degradation of the electrical insulation. However, prolonged time of PD exposure has impact on electric power equipment lifetime, due to deteriorations in tiny voids, development of treeing channels in solid insulation, or surface erosion effects at the solid-gas interfaces. PD-based diagnostics of power equipment has a long history, e.g., [1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18][19][20], and is prone to scientific enhancements. The statistical

Partial Discharge Based Diagnostics
Diagnostic methodologies that are comprised of sets of measuring methods and systems used to assess the condition of objects as well as the possibilities of their further operation are of fundamental importance in the strategies of operating electrical devices, both in power grid and industrial applications. With regard to high-voltage electrical power equipment, diagnostic investigations mainly concern the insulation systems, which are the main structural elements of these devices. Unavoidable operational exposures (which include the electric field in high-voltage insulation systems, thermal, mechanical, and chemical stresses) are the causes of partial discharges, which initiate degradation processes in the dielectric structures. Partial discharges in high-voltage electrical devices are the main threats to their failure-free operation and apply to all groups of such devices. The lifetime and endurance of electrical high-voltage insulation is determined by its integrity and is expressed by the presence of partial discharges; these are the phenomena occurring in the internal structure of dielectrics or on their surfaces that lead to gradual degradations and, ultimately, breakdowns. New diagnostic challenges have resulted from the great progress in digital signal and image processing, advanced techniques such as machine learning, AI, smart sensors, and communication as well as the application of new materials in insulating systems (e.g., synthetic polymers, functional dielectrics, or nanocomposites). Modern diagnostics deals with a complementary set of techniques and methodologies that are object-and application-tailored, e.g., [25][26][27][28][29][30][31]33,39]. The non-invasive and non-destructive character of the PD-based diagnostic methods make it especially attractive for diagnostics and monitoring purposes. The phase-resolved partial discharge analysis (PRPDA) is established nowadays as the most accepted tool in the field of PD-based diagnostics of HV electrical insulation [2]. This method is based on acquisition of individual partial discharge signals with reference to the phase position of the applied high voltage. The measuring approach is based on combined two-dimensional multi-channel analyzers and is highlighted in Figure 1 along with an exemplary PD monitoring sequence. Since real PD physical phenomena reveal the statistical nature, a method based on phase-resolved partial discharge images is particularly helpful. For example, phase position of an individual PD within the high voltage AC period delivers complementary information, which enables for partial discharge form recognition, separation, and classification in a phase-resolved domain. The recorded partial discharge patterns, associated with various stages of discharge evolutions, may be regarded as images [2,[12][13][14]38]. Among the tailored and object specific diagnostics algorithms, there are also generalized methodologies, common for all approaches, and especially attractive for future autonomous diagnostics systems. The common methods, presented in this paper, refer to anomaly detection, trend evolution, and feature extraction in partial discharge patterns.

Detection Techniques of PD Pattern Motion and Feature Extraction
The effective PD-based diagnostic and monitoring systems require detection techniques for partial discharge pattern analysis. The high voltage insulation degradation is revealed in the evolution of PD patterns acquired in time periods. Apart from PD pattern evolution, the image may contain superimposed transient disturbances or effects of harmonic modulation. Such diagnostic systems usually operating on phase-resolved PD images should detect anomalies in PD patterns, identify critical moments in the trend evolution, and provide feature extraction mechanisms, as graphically highlighted in Figure 2. Presented in that figure, three classes are associated with the corresponding methodologies analyzed in the paper. The feature extraction approach is based on the use of various image processing techniques for the separation of characteristic elements in the image according to certain criteria. The example described in this paper refers to image segmentation using K-means and detection of coherent forms in the images.
The anomaly detection algorithms can trigger the early detection of the trend changes or the appearance of a new discharge form, and hence are suitable for PD monitoring applications. This class is represented by One Class SVM and Local Outlier Factor. Anomaly detection can also handle transients and disturbances that appear in the PD image as an indication of an abnormal state. Transients may reveal various forms, such as one-shot propagating switching over-voltages, more seldom lightning ones, but also continuous ones such as external corona. Another class of disturbances is related to power electronic equipment and for example transients propagating from converter switching, which are usually coherent with recorder phase-resolved pattern. Attention should be also paid to the influence of harmonics, which may modulate the PD pattern and significantly influence the origin of partial discharges in the acquired PD image. The main problem in PD measurements is related to proper identification between real partial discharge impulse and external transients or disturbances. The big improvement in that field was the introduction of the phase-resolved acquisition, which allowed for separation of discharges along the phase angle of high voltage. In this way, PD having even smaller magnitude than repetitive impulse disturbances or external corona, can be separated on the PRPD plane. Another problem occurs with power electronics equipment and semi square HV stimuli. In this case, the high voltage spectrum usually overlaps with the PD spectrum and cannot be easily filtered out, as in case of sinusoidal excitation. Thus, the detection is performed often in an ultra-high frequency band using antennas. The future monitoring systems should be equipped with trend evolution algorithms. In this context, two examples of insulation aging and application of PD-based monitoring are shown. The first one refers to the deep convolutional neural networks used for classification of deterioration stages in HV insulation specimen. The latter one demonstrates application of the optical flow approach for motion detection in partial discharge images. In this method, the sequence of PD images is (treated as a video frames) exposed to on-the-fly scanning, and notification in case of deviations in subsequent images is provided.

Feature Extraction in PD Images
A key element of artificial intelligence is its automatic feature extraction and segmentation of images. This also refers to partial discharge patterns used for diagnostics and monitoring applications. One of the new directions of PD image processing (described in the following part) might be related to the motion estimation of PD image development. This aspect could be interesting in applications such as PD monitoring, where the trends and rates of cluster changes could be observed and assessed instead of the absolute discharge magnitude. In this aspect, low-level segmentation methods are of special interest; e.g., intensity thresholding, edge detection, region growing, morphological operators, or more-advanced syntactic methods of pattern recognition [47,48]. Since partial discharge images can be associated with different forms depending on the physical mechanisms as well as the different objects that are usually manifested in various high-voltage insulating materials, the feature extraction, clustering, and segmentation methods have an underlying importance. A commonly used clustering algorithm is called K-means, where K refers to the specified number of clusters. A cluster refers to a collection of data points that are aggregated together due to certain similarities. For image segmentation, the clusters indicate different image colors. This approach belongs to the unsupervised machine-learning category, without providing data labels and expecting the machine to derive the cluster structure from the data on its own. This is also called flat clustering, where the machine receives information on how many categories into which to cluster the data, in contrast to hierarchical clustering, where the machine is allowed to decide how many clusters to create based on its own algorithms. The K-means algorithm starts with the selection of K random prototype points and assigns the data points to the closest centroid. In the following steps, the distances in the clusters are measured and updated until convergence; i.e., finding the least variance in the groups by minimizing an optimization function according to a certain criterion. The updated centroid location is obtained by calculating the center of gravity inside the temporary cluster. Formally, the algorithm aims to minimize an objective function in the form of a squared error function O KM of a distance between a data point x j i and the cluster center c j containing L data points in one of the K clusters. (1) The partial discharge phase-resolved images reflect the physical phenomena of the discharges gathered during a certain acquisition time period on a statistical domain. The magnitude of the discharge pulse is essentially determined by the breakdown voltage of the cavity and phase position with respect to the high-voltage waveform. This mechanism might be influenced by the statistical time lag (defined as the time of the appearance of the initiating electron), which changes the breakdown voltage inception level and, thus, the pulse magnitude and phase position. In order to assess the PD pattern, intelligent autonomous PD expert systems need to determine the number of clusters in a PRPD plain at the first instance. The idea of this approach is to identify autonomously the best number of K means. In this way, the system is performing certain representations of clusters and fitting to the possible partial discharge scenarios of patterns. Such scenarios may be related to the systematic growth, identification of disturbances, or appearance of another PD form. The presented results were coded in Python with the OpenCV image processing framework [33]. The K-means-based clustering examples of PD images obtained in various insulating systems are shown in Figures 3-6. The first example refers to partial discharges recorded in medium-voltage electrical machine insulation (Figure 3a), where characteristic groups of discharges from the positive and negative sinusoidal voltage periods were extracted into K = 2 and K = 4 sub-clusters (respectively, as illustrated in Figure 3b,c).   The color palette in the PD image reflects the intensity of the discharges in certain phase slots of a high-voltage period. The PD image shown in Figure 4a reflects the stage where two distinguishable groups per phase can be identified. In a first approximation for K = 2, two PD groups from the positive and negative voltage periods are automatically clustered properly ( Figure 4b) along with the impulse overshoots in each phase, forming the opposite tiny clusters. In the case of K = 4, each of the previously extracted clusters is subdivided according to its intensity ( Figure 4c).
The PD image presented in Figure 5a corresponds to the corona effect reflecting the discharges in air at a high electric field (usually around the sharp edges). The corona starts during the negative half-period, which has been identified in the clustered image in Figure 5b. Three elements in this negative discharge group have been extracted: one depicting the nucleus of the corona (marked in the aquamarine color), followed by the dark-green group corresponding to the tail, and the third (highlighted in olive) indicating the discharges with small magnitudes.
The high-voltage electrical equipment is in real transmission or distribution networks exposed to various disturbances. One of the typical examples is the presence of harmonics at a high voltage [42]. The distorted voltage waveform has a crucial impact on the PD phaseresolved images, introducing an additional modulation effect (as shown in Figure 6) [33]. The segmentation of a PD image containing the 3rd and 5th harmonics at a 50-Hz high voltage (Figure 6a) by the K-means-based extraction of four clusters is illustrated in Figure 6b. Introducing higher harmonics such as the 11th (Figure 6c) has introduced sharp PD image modulation. The six clusters extracted by the K-means algorithm (Figure 6d) reflect the separate PD groups, also taking the discharge intensity into account. In this way, the low-intensity sub-clusters marked in aquamarine and black are identified and classified into a separate group. Another example of partial discharge image clustering is presented in the patterns obtained from discharges recorded in HV cables in an industrial environment that contains elevated levels of noise and disturbances ( Figure 7a) [33]. In this case, the low-level discrimination has been increased during acquisition to eliminate most of pulses, noncoherent with HV excitation. The remaining elements stretch across the entire pattern. Due to high amplification factor the strong overshoot pulses are also present in the pattern. The sequence of clusters extracted by the K-means image segmentation process is shown in Figure 7b-d for a K equal to 2, 3, and 4, respectively. The background was treated as a separate class in this case.
The four-class segmentation (Figure 7d) reflects the original PD image well (Figure 7a), whereas the regions are identified and can be individually highlighted or masked in the segmented case. Such an effect is shown in Figure 7e,f, where only one cluster is selectively highlighted in pink (i.e., in the first case, Cluster 2, and in the latter one, Cluster 3). The automatic segmentation with selective filtering of subclasses is a useful feature, both for experts operating manually on the PD pattern and for future autonomous systems. In this way, assessment and interpretation can be focused on certain sub-elements of the whole pattern.
The following example presents the case of PD acquisition in HVDC containing a superimposed 50 Hz AC harmonic. In the classic partial discharge acquisition with DC voltage, the time mode is usually applied, as there is no phase voltage angle present anymore [49]. The case with the superimposed harmonic with the dominated DC voltage allows for the synchronization with the AC harmonic component and acquisition in the semi-AC mode (Figure 8a). The segmentation into four clusters using K-means and highlighting Cluster 2 is shown in Figure 8b. This cluster (marked in pink) corresponds to the inception of the discharges coming from the AC component superimposed on the HVDC. The PD image presented in Figure 9a was recorded during the PD imaging experiment with the simultaneous observation of streamer channel development in air in the needleplain configuration. The pattern contains the main spot originating at the maximum of the applied voltage with a long vertical tail that has a gradually decreasing intensity. The goal was to automatically extract the PD hot spots (the main cluster highlighted in pink) using K-means with four clusters (as shown in Figure 9b). The PD image presented in Figure 9a was recorded during the PD imaging experiment with the simultaneous observation of streamer channel development in air in the needle-plain configuration. The pattern contains the main spot originating at the maximum of the applied voltage with a long vertical tail that has a gradually decreasing intensity. The goal was to automatically extract the PD hot spots (the main cluster highlighted in pink) using K-means with four clusters (as shown in Figure 9b).

Anomaly Detection in PD Patterns
Anomalies are data patterns that have data characteristics that are different than those from normal instances. Anomaly detection is a useful operation in autonomous partial discharge diagnostics systems. Nowadays, such systems operate mostly on 2D PD datasets in the form of images. Partial discharge images contain a statistical distribution of discharges recorded synchronously with the applied voltage having a sinusoidal, semisquare, or other waveform. The phase-resolved acquisition within a certain time period results in the probabilistic intensity patterns that are characteristic for different forms of discharges in various HV electrical insulating systems. These images may additionally contain the superposition of distinctive discharge forms as well as disturbances or noise signatures. In this way, an anomaly-detection algorithm coping with multimodal data is able to distinguish high-density regions and potential outliers. On the one hand, anomaly detection can handle noise and disturbances that appear in the PD image; on the other

Anomaly Detection in PD Patterns
Anomalies are data patterns that have data characteristics that are different than those from normal instances. Anomaly detection is a useful operation in autonomous partial discharge diagnostics systems. Nowadays, such systems operate mostly on 2D PD datasets in the form of images. Partial discharge images contain a statistical distribution of discharges recorded synchronously with the applied voltage having a sinusoidal, semi-square, or other waveform. The phase-resolved acquisition within a certain time period results in the probabilistic intensity patterns that are characteristic for different forms of discharges in various HV electrical insulating systems. These images may additionally contain the superposition of distinctive discharge forms as well as disturbances or noise signatures. In this way, an anomaly-detection algorithm coping with multimodal data is able to distinguish high-density regions and potential outliers. On the one hand, anomaly detection can handle noise and disturbances that appear in the PD image; on the other hand, it can provide early detection of the trend changes in monitoring applications or the appearance of a new discharge form related to the underlying physical phenomena in HV insulating systems. In the unsupervised mode, selecting the best-performing algorithm might be a challenge in the absence of labeled data. In this context, the presented comparison of the anomaly-detection approaches provides application hints. The presented examples were programmed in the Python environment with the Sklearn framework [50]. The following algorithms were tested on the PD images: - OneClassSVM-a variant of the SVM (support-vector machines) method especially tuned for the so-called novelty detection. The main modification done by [51] restricted the classification to one class, yielding an algorithm that was focused on anomaly detection. It learns the boundaries of the points in the class and, therefore, can classify any points that lie outside the boundary as outliers. The radial basis function (RBF) kernel (popular in machine learning) was applied. The RBF kernel is defined as follows on two samples (x and x ) that are represented as feature vectors: where the metric is a squared Euclidian distance between two feature vectors, and σ is a parameter. Setting of parameter σ influences the selectivity of the boundaries. -IsolationForest-this algorithm is built on the basis of decision trees and assumes that outliers are spaced further away from the regular observations [52]. -LocalOutlierFactor-the anomaly score of each sample in a data set. This measures the local density deviation of a data set with respect to its neighbors. Thus, it highlights isolated objects with respect to the surrounding neighborhood. The metrics are defined by the k-nearest neighbors, whose distance is used to estimate the local density. By comparing the local density of a sample to the local densities of its neighbors, one can identify samples that have a substantially lower density than their neighbors. In this way, the outliers are extracted and classified as anomalies.
The anomaly-detection algorithms were tested on five different classes of PD images (shown in the left column of Figure 10) representing different forms: -PD in gas-filled instrument transformer (top row in Figure 10); -PD in MV cable insulation; -corona discharges; -discharges in electrical machine insulation; -PD pattern modulated by 11th harmonic.
The decision boundaries between the inliers and outliers are displayed in the plots in Figure 10 (in black for the first two methods that have built-in prediction).
The comparison shown in Figure 10 demonstrated the isolation of individual pulses or low-density PD populations as outliers. The Isolation Forest approach has rather clustered whole regions or segments in the PD image, whereas OneClassSVM creates boundaries more selectively around the individual pulses for kernel parameter σ 2 = 0.1 and less selectively for σ 1 = 0.001. Local Outlier Factor classifies the individual pulses and lowdensity envelopes of the characteristic PD groups as outliers. The presented approach might be very useful in identifying non-coherent noise and disturbances as anomalies in a PD pattern in future autonomous PD expert systems.

Trend Evolution in PD Patterns
One of the key elements of modern diagnostics is determination of the trend evolution. This aspect is highlighted in the high voltage insulation diagnostics based on PD patterns. Strategically important devices in the electrical grid system, such as power transformers, gas insulated substations, switchgears, etc., are gradually more and more equipped with monitoring systems. The digital transformation of the grid elements is driving a ubiquitous Internet-of-Things (IoT) connectivity. However, the monitoring platforms, apart from the big data collections, require decision-oriented reasoning. The foundation of this process is related to trend observation and determination of the evolution phases. In this paper, two examples of trend evolution in PD images are presented. The first one refers to the application of deep convolutional neural networks, whereas the latter refers to optical flow algorithms.

Application of Deep Convolutional Neural Networks
Artificial neural networks (ANN) are perceived nowadays to be among the best classification techniques. Especially disruption offered by deep convolutional neural networks (CNN) in image processing is observed in many engineering applications. The novelty in CNN architecture refers to reduced interconnections in interlayers due to introduction of convolutional layer. The fully connected layers are replaced in this section by transformation of input image I convolved with a light kernel M, called filter, into output image O, as stated by the equation: where: L-denotes number of filters; l-filter index; M, N-size of filter. The coefficients of a filter M k are determined during backpropagation training process.
As an example, a monitoring sequence of PD patterns was analyzed by CNN. The test specimen was subjected to a high electric field undergoing insulation aging and deterioration. Simultaneously, the PD images were recorded in a long time-stamped sequence. The details about the experiment and setting of the CNN are presented in [36]. The four characteristic classes of the HV insulation aging were associated with the stages of the insulation deterioration, and were denoted as Stage 1, Stage 2, and Stage 3. These stages may reflect for example the normal, warning, and alarm conditions. In addition, the 4th class represents the possible disturbances, which may occur during PD acquisition. The graphical representation of distinctive classes is shown in Figure 11. The convolutional neural network topology applied to PD patterns in monitoring application is shown in Figure 12. In the presented example, the CNN may contain up to 6 convolutional Conv2D and MaxPooling layers, which are followed by up to 5 fully connected (FC) hidden layers, each having from 128 to 1024 sigmoidal nodes. The dimension of an output layer contains a number of outputs that is equal to the number of subclasses of PD pattern. The PD images had a format 128 × 128 × 3 and applied kernel filter had a size 5 × 5 pixels. The size of convolution kernels M was selected in a range from 32 to 128 [36]. In the presented example, the recorded data block of PD images was subdivided in 3 groups, as training, validation, and test sets. The first group is used for adjusting the weights in a backpropagation process. The validation data set is used for tuning the parameters, whereas the test group is used to validate the efficiency of the entire network. The recognition score may be visualized as an array, with the rows corresponding to the separable classes and columns reflecting the size of the test sets. The exemplary colored score array displaying recognition probability after 50 epochs is shown in Figure 13. Popular network performance measure is defined as accuracy A; reflecting the correct fraction of network predictions: where TP-true positives; TN-true negatives; FP-false positives; FN-false negatives.
In Equation (4), true positive (TP) and true negative (TN) are denoted as the number of correctly classified images. False positive (FP) and false negative (FN) are reflecting the number of misclassified patterns. The classification performance of CNN, with respect to various hyperparameters and topology, in PD aging test is shown in Table 1. The results refer to the exemplary PD pattern belonging to class 'Stage 3 in the form of accuracy A of the proper assignment to the actual class. Comparison of 2D convolution topologies along with various stages of FC fully connected neural network layers reveals accuracy variations (Table 1). A consequence of lower number of kernel filters (16)(17)(18)(19)(20)(21)(22)(23)(24)(25)(26)(27)(28)(29)(30)(31)(32) is downgrading of the accuracy. In a topology of FC section of neural network, up to four FC layers were tested (1024-1024-512-4). An interplay between the numbers of convolutional layers and fully connected layers was noticed. The PD monitoring example presented in this chapter has highlighted the application of CNN for trend evolution observation and assessment.

Optical Flow Based Motion Detection in PD Images
The evolution of static PD pattern during power equipment exploitation can be attributed to motion in PD images. In this way, trend evolution of the partial discharge activity can be traced for diagnostic purposes. A novel approach in image processing suitable for this operation is an optical flow [42][43][44][45][46], which is broadly tested for movement detection and traction in people movement, autonomous cars, robotics, and medicine. The optical flow methodology offers spatio-temporal identification of trend and course evolution in partial discharge images. Such a feature is highly attractive both for manually operated domain experts and for intelligent machine learning frameworks. Since optical flow has been successfully applied to the video frames, the proposed approach for PD analysis opens new perspective with on-the-fly tracking and notification for future autonomous monitoring systems. The optical flow method operates on the brightness elements and derives a vector of motion, which reflects both the temporal and spatial image gradients of a train of subsequent frames. The foundation of the approach originates from video processing [53,54]: • the intensities of pixels do not change significantly between consecutive images; • the time elapsed between frames is short enough in order to use differentials to denote motion change; • adjacent pixels represent comparable motion.
It is important to notice, that for partial discharge images, the meaning of time is rather different than in the case of pure video streaming. The temporal aspect in PD analysis refers to collection of diagnostic images or successive images from monitoring trend observations. The optical flow methodology applied to PD images is graphically presented in Figure 14. The graphical evolution of a PD image I(x, y, t) is shown in Figure 14, where elements of the pattern undergo expansion (Figure 14a) along the phase axis between time moments t and t + ∆t, as well as simultaneous motion and expansion along both the phase and charge axes (Figure 14b). The presented example is based on the Lucas-Kanade (LK) approach [46]: I(x, y, t) = I(x + ∆x, y + ∆y, t + ∆t), where I(x, y, t) represents the intensity of pixel (x, y) at time t, ∆t is a time interval, ∆x is the x-direction displacement distance, ∆y is the y-direction displacement distance. After transformations, the optical flow equation has following form: Denoting v x = dx dt and v y = dy dt as vector directional components of optical flow, the above equation can be rewritten: where I x , I y indicate gradient of an image, in the x and y directions, and I t is a gradient along time.
In this notation, flow vector k = [v x , v y ] is pointing towards the direction where pixel (x, y) is moving. The methodology based on the Lucas-Kanade approach has been coded in the OpenCV framework. It provides solution of the above equation. In the basic form, the LKtracking algorithm based on a sparse optical flow is tracing distinctive points such as the corners [43]. Sparse optical flow provides the flow vectors of some "characteristic features" (e.g., pixels representing the corners or edges of an object), unlike dense optical flow, which yields the flow vectors of the entire image for all pixels. Thus, motion detection is based on two steps, first, the distinctive points are marked, and then the tracking approach is used for this set of elements. The identification of characteristic points is performed by the Shi-Tomasi algorithm implemented in the OpenCV framework. In the following step, the Lucas-Kanade optical flow approach is applied to interactively track the movement of these points between subsequent images. In the PD-based diagnostics, the sequence of patterns may be acquired from cyclic inspections accomplished in time intervals or in the case of monitoring from PD image streaming according to the time stamps. In the pre-processing stage, the thresholding operation can be applied to eliminate the background noise or the irrelevant structures in the PD image [46]. The presented motion detection example relates to the chain of partial discharge images acquired in an aging monitoring experiment of dry-band arcing appearing on a cable insulation surface exposed to a rainfall. Initially discharges are triggered on the droplet surfaces subjected to high voltage (Figure 15a). In the following phases, a stronger corona and surface discharge are progressing (Figure 15b). Due to a fall intensification a dry-band arcing occurs and strong surface discharges are observed (Figure 15c). In these images, the dots mark the distinguished corner points, reflecting significant transitions in the pattern composition. The lines depict the vectors of motion, showing a directional vector between subsequent frames and indicating the pattern growth's directions. In this way, dry-band arcing monitoring reveals a trend of partial discharge intensity. It should be underlined that the meaning of frames in optical flow applied to PD diagnostics is different comparing to the conventional interpretation known in video sequences and streams. In the presented method, the PD have been recorded in a form of phase-resolved patterns within a certain time, forming a sequence of PD images. What is crucial here is the perception of time elapsed between the partial discharge image frames, which may vary from a few orders of magnitude depending on the insulation of power equipment, electrical stress, environmental conditions, discharge physics, etc. It can extend from fraction of seconds, throughout hours up to weeks or months in cases of very slow degradation processes. The speed of image acquisition might also be adaptively tuned, depending on the analyzed rate of phenomena development. However, the presented methodology is generic and can be applied to trend evolution assessment in many applications.

Conclusions
Diagnostic methodologies are of fundamental importance in the strategies of operating electrical devices, both in power grid and industrial applications. This paper reports the application of various image processing techniques to partial discharge images, with a special focus on anomaly detection, trend evolution, and feature extraction. The analyzed images have a form of phase-resolved PD patterns. In each of the above-mentioned classes, dedicated image processing algorithms were applied. Segmentation techniques were applied for feature extraction, anomaly detection is focused on outliers identification, whereas for trend evolution convolutional neural networks and optical flow were used. Application of presented methods in the partial discharge field might depend on whether the case concerns monitoring or a diagnostics session. For example, the OneClass SVM depending on sigma setting allows for quite precise detection of incremental growth of the image and is thus accurate for monitoring case. Whereas in the case of Insulation Forest global boundaries are denoted, and it might indicate more coarse changes, for example related to the appearance of additional forms of discharges or certain disturbances. The classification and identification of features in PD images is perceived as a crucial requirement for an efficient diagnosis of high voltage insulation. The future monitoring systems should be equipped with trend evolution algorithms. The presented examples referred to the intrinsic functionalities of future autonomous partial discharge-based diagnostics systems. Apart from quantitative measurements it is expected that qualitative evaluation, especially in the case of monitoring systems, will play a bigger role. It refers both to trend analysis and deviations of PD patterns from canonical forms. The presented various approaches of trend evolution and anomaly detection in PD images might be directly applied in electrical insulation diagnostics systems of power equipment. The purpose of the presented research was to further automate pattern processing by machine-controlled algorithms, striving towards intelligent and autonomous PD-based diagnostics.