Event Detection in MicroPMU Data: A Generative Adversarial Network Scoring Method
Abstract
A new datadriven method is proposed to detect events in the data streams from distributionlevel phasor measurement units, a.k.a., microPMUs. The proposed method is developed by constructing unsupervised deep learning anomaly detection models; thus, providing event detection algorithms that require no or minimal human knowledge. First, we develop the core components of our approach based on a Generative Adversarial Network (GAN) model. We refer to this method as the basic method. It uses the same features that are often used in the literature to detect events in microPMU data. Next, we propose a second method, which we refer to as the enhanced method, which is enforced with additional feature analysis. Both methods can detect point signatures on single features and also group signatures on multiple features. This capability can address the unbalanced nature of power distribution circuits. The proposed methods are evaluated using realworld microPMU data. We show that both methods highly outperform a stateoftheart statistical method in terms of the event detection accuracy. The enhanced method also outperforms the basic method.
Keywords: MicroPMU data, power distribution, event detection, deep learning, generative adversarial network, feature analysis.
I Introduction
The voltage and current measurements that are reported by distributionlevel phasor measurement units, a.k.a, microPMUs, have highresolution and highprecision. They significantly enhance our visibility into the distribution grid, [18, 10]. Applications of microPMU data include topology and phase identification [4], load modeling, [14], state estimation [3], asset monitoring [17], and distribution system cybersecurity [7].
An important and emerging class of studies when it comes to microPMU data is to investigate the events in distribution systems. Here, an event is defined rather broadly and may refer to load switching, capacitor bank switching, connection or disconnection of distributed energy resources (DERs), inverter malfunction, a minor fault, a signature for an incipient fault, etc. [19, 9, 16]. Undoubtedly, the very first step to investigate the events in microPMU data is to detect them from the large volume of data that is being collected. Note that, each microPMU reports over one hundred million data points every day.
The literature on event detection in microPMU data can be divided into two broad classes; namely statistical methods, such as in [6, 15, 2], and machine learning methods, such as in [21, 20]. Such common categorization have been utilized in other areas of study within smart grid literature, for instance anomaly detection in smart meters [1] and IoT systems [13]. The statistical method in [16] uses the absolute deviation around median, combined with dynamic window sizes. In [2], the analysis of the inverse power flow problem is combined with the turning point test method to detect events. In [6], the physical equations of the power distribution circuits are combined with techniques from statistical quality control in order to develop a hierarchical anomaly detection architecture that uses data from optimally placed microPMUs.
While we use the stateoftheart statistical method in [16] as a benchmark for performance comparison in this paper, our approach here is rather based on machine learning. In [21], a machine learning method, called ensembles of bundle classifiers, is used to train multiple classifiers based on multiple instances of the same predetermined event, so that the patterns of that event are learned in order to detect more instances of that event in the microPMU data. In [20], a hidden structure semisupervised machine learning model is established to combine microPMU data for both labeled and unlabeled events. A parametric dual optimization procedure is used to tackle the nonconvex learning objective function.
The event detection method in [21] is based on supervised machine learning. Also, the method in [20] is based on semisupervised machine learning. In both cases, full or partial expert knowledge is needed in order to establish the event detection tool. In contrast, in this paper, we develop an unsupervised method to detect events in microPMU data. This eliminates the need for human labor; which makes our proposed approach suitable for implementation in practice when we work with large volumes of microPMU data. It is worth adding that unsupervised learning is previously used in the analysis of microPMU data, but as a feature extraction tool for event classification [11]. Therefore, it has not been used for event detection, which is the focus of this paper.
The event detection methods that are proposed in this paper, work by constructing deep learning Generative Adversarial Network (GAN) models. The contributions are as follows:

To the best of our knowledge, this is the first paper to develop event detection methods for microPMU data based on GAN models. Two such methods are proposed. The first one, called the basic method, trains a single GAN model. The second one, called the enhanced method, involves additional analysis of the features of the microPMU data; which leads to training two GAN models.

Both methods are unsupervised deep learning methods, which require no or minimal human knowledge; which makes them suitable for automated and scalable operation. Furthermore, they can detect both pointsignatures and groupsignatures in microPMU data. This is an important capability because of the unbalanced nature of power distribution circuits; where many events may affect only a subset of the features on only one or two phases.

Realworld microPMU data is used to evaluate the proposed event detection methods. In order to create a reference, first, more than 1000 events of different kinds are extracted manually from the microPMU data within a given period of time. It is observed that both the basic and the enhanced methods highly outperform a prevalent statistical method. The advantage is particularly major for the events that cause small changes in magnitude. Also, the enhanced method outperforms the basic method; thus confirming the importance of the revised model.
Ii Methodology
Iia Basic Method
In its core, the proposed basic event detection method uses a GAN model which has two components, a generator and a discriminator. The generator is a deep neural network that tends to produce data samples that follow the distribution of the historical training data. The discriminator is a deep neural network that tends to distinguish between the data samples generated by the generator and the true historical data. By training the generator and the discriminator subsequently and iteratively, the GAN model can achieve an equilibrium, at which the discriminator can no longer distinguish between the distribution of the generated samples and the historical data.
Features
As in [16, 6], we use the following timeseries as the features to train the GAN model in our basic method: 1) magnitude of voltage, i.e., ; 2) magnitude of current, i.e., ; 3) active power, i.e., ; and 4) reactive power, i.e., . All these features are defined separately for each three phases. Therefore, in total, the GAN model is trained with 12 timeseries. Note that, while microPMUs measure and directly, and are obtained rather indirectly by combining and with the measurements on voltage phase angle and current phase angle, which are both provided by microPMUs.
Generator
It takes a noise vector from a distribution function , such as ), and tries to produce samples similar to the ones from the true sample distribution. We seek to train a neural network to generate samples which follow the distribution of the historical data. Here, denotes weights of the generator network. Mathematically, we seek to minimize the following objective function [5]:
(1) 
where is the number of samples in each training batch, is the discriminator function, is the generator function, and is the random vector for th generated sample. In order to train the generator, after forward propagation, we need to update the generator parameters by calculating gradient and using a proper optimizer, such as Adam optimizer [8].
Discriminator
It is meant to distinguish between the fake data samples generated by the generator and the real measurements. Our goal is to train a neural network , which creates a single scalar value as its output. Here, is the vector of the actual measurement data and is the weights of the discriminator network. The primary objective of the discriminator is to maximize the probability of distinguishing between the true measurement data and the data generated by the generator. Therefore, we seek to minimize:
(2) 
where is the th real sample and the second term is the same as the term in (1).
Together, the generator and the discriminator play a minmax game with the following value function:
(3) 
Training
Both the generator and discriminator are formed with Long ShortTerm Memory (LSTM) modules, which are connected backtoback to capture the relationship between different features and their time dependencies. The microPMU data is normalized and segregated into sequences of training blocks. The value of can attain its global optimum by satisfying the following two conditions:

C1: For any fixed , the optimal discriminator is:
(4) 
C2: There exists a global solution such that:
(5)
If these conditions are not satisfied at the equilibrium, then the training is repeated with new random initial points. More details on the training mechanism can be found in [5].
Event Scoring
After training the basic model, the blocks of microPMU data stream are passed to the discriminator and the output is a scalar number which is defined as score. We pass the whole training set to the discriminator and calculate the scores. A normal probability distribution function (pdf) is fitted to the obtained scores, i.e., , due to the fact that these scores must be very close to the global optimum, see (4) and (5). This is because of the infrequent nature of the events in power distribution systems.
Algorithm
The proposed basic event detection method is summarized in Algorithm 1. It works based on the fact that events in microPMU data are infrequent. In fact, our analysis of the realworld microPMU data shows that events occur at about of the times. Thus, the default for the trained model must be the normal operation of the power distribution system. As a result, the discriminator is essentially trained to distinguish between the absence and the presence of the events, which is exactly what is needed in order to detect the events.
It should be noted that, a common choice for in the threshold is 3, known as the threesigma rule [12].
IiB Enhanced Method
The basic method in Section II.A requires training a single GAN model, where the features are , , , and . However, given the characteristics of the microPMU data, in this section, we propose to develop and train two separate GAN models, one for the voltage measurements , and another one for the rest of the measurements, i.e., , , and .
Feature Analysis
After applying the basic method to realworld microPMU data, we observed that Algorithm 1 sometimes fails to detect events that demonstrate signatures only in voltage magnitude. Such event cannot trigger the score to exceed the threshold. Further investigation revealed that this is because, in power distribution systems, voltage measurements are much less volatile than current measurements. Therefore, the GAN model sometimes cannot properly extract the characteristics of the voltage measurements.
Training Multiple GAN Models
To remedy the above issue, we propose to construct two separate GAN models that are trained in parallel. One GAN model, denoted by , has 3 features as its input, which are the voltage magnitude measurements across the three phases. The other GAN model, denoted by , has 9 features as its input, which are current magnitude, active power, and reactive power measurements across the three phases. Importantly, it is observed that has high correlations with and even , which makes it desirable to combine , , and into one GAN model; as opposed to having four GAN models for , , , and .
Event Scoring
Once each of the two GAN models is trained, the resulting Discriminator function is used to generate its own scores. An example for the scores that are generated by the two GAN models are shown in Fig. 1. The blue dots represent normal data. The red dots represent events. We can see that each of the two GAN models detects only a subset of events. The events that are scattered across xaxis are the ones that are detected by . They include the majority of the events. The events that are scattered across yaxis are the ones that are detected by . Thus, both GAN models are both needed to enhance accuracy of event detection.
Algorithm
The proposed enhanced event detection method is summarized in Algorithm 2. It works by examining the scores of the two separate GANs; thus having a dedicated deep learning architecture to detect the events in voltage magnitude and another deep learning architecture to detect the events that involve the current, active power, and reactive power. The rest of the algorithm is similar to Algorithm 1.
Iii Experimental Results
The proposed event detection methods are applied to the realworld data from a distribution feeder in Riverside, CA [16]. The resolution of the data is 120 readings per second. In total, 1.8 billion measurement points are analyzed. In particular, two weeks of data are used to train the GAN models. One day of data is used to test the event detection methods. Event detection is applied on windows of size 40 data points. Each window has an overlap of size 20 data points with the next window in order to assure not missing any event.
Iiia Performance Comparison
The effectiveness of the event detection methods is investigated over 1000 reference events in microPMU data, that are visually extracted within a specific period of time.
The summary of the results are shown in Table I. We can see that the basic method significantly outperforms the benchmark statistical event detection method in [16]. Furthermore, the enhanced method considerably outperforms the basic method. Next, we explain the underlying causes for these differences by going through several examples of the events that are detected.
Benchmark [16]  Basic Method  Enhanced Method  

Accuracy  0.3640  0.6943  0.8805 
F1score  0.3614  0.7676  0.9023 
IiiB Assessment of the Basic Method
Figs. 2 to 6 show five examples of the events that are detected by the basic method. Importantly, the prevalent statistical method in [16] detected only the first two of such events. Regarding the events in Figs. 4 and 5, they are not detected by the method in [16] because the changes in the magnitudes are relatively small and do not significantly affect the statistical measures, such as the absolute deviation around median. As for the event in Fig. 6, all the pieces of this long event are detected by the basic method at several subsequent windows of the data. However, the statistical method in [16] only captures the step change the beginning of this event; because the statistical characteristics remain the same afterwards.
IiiC Assessment of the Enhanced Method
Figures 7 and 8 show two events that are detected by the enhanced method. But they are not detected by either the prevalent statistical method in [16] or even the basic method. The basic method fails to detect these two events because the main signatures are in voltage and they are relatively small in magnitude. Therefore, only the additional GAN model in the enhanced method can capture these events. This demonstrates the importance of the change in the model that was proposed in the enhanced method. Regarding the event in Fig. 8, it demonstrates momentary oscillations that started only after some sort of actions, possibly a tap changing event, where the oscillations damped after a short period of time. Events like this are important, for example, for asset monitoring. However, only the enhanced method was able to detect such event.
Iv Conclusions
Two novel unsupervised deep learning methods are proposed to detect events in microPMU data streams. They work by constructing Generative Adversarial Network (GAN) models. They are capable of extracting the characteristics of a wide verity of events in large volumes of microPMU data. The basic method involves a single GAN model. The enhanced method is equipped with additional analysis of features. It involves training two parallel GAN models. Both methods are capable of detecting events with pointsignatures and groupsignatures. They are particularly wellsuited to detect the events in distribution systems where the event may impact only a subset of the features and only or two phases; in addition to the cases that all three phases are affected. Realworld data from microPMU field installation is used to evaluate the performance of the proposed event detection methods. It is observed that the basic method significantly outperforms a prevalent statistical event detection method in the literature. Furthermore, the enhanced method considerably improves the performance over the basic method. Several examples of the events that detected by different methods are shown and discussed in order to understand the characteristics of the proposed unsupervised event detection methods.
References
 (201908) Unsupervised learning for online abnormality detection in smart meter data. In IEEE PES General Meeting, Cited by: §I.
 (201707) Event detection and localization in distribution grids with phasor measurement units. In IEEE PES General Meeting, Cited by: §I.
 (201905) Linear distribution system state estimation using synchrophasor data and pseudomeasurement. In 2019 International Conference on Smart Grid Synchronized Measurements and Analytics (SGSMA), Vol. , pp. 1–6. External Links: Document, ISSN Cited by: §I.
 (2019) Topology identification in distribution systems using line current sensors: an milp approach. IEEE Trans. on Smart Grid (), pp. 1–1. External Links: Document, ISSN Cited by: §I.
 (201406) Generative Adversarial Networks. arXiv eprints, pp. arXiv:1406.2661. External Links: 1406.2661 Cited by: §IIA2, §IIA4.
 (201807) Anomaly detection using optimally placedsensors in distribution grids. IEEE Trans. on Power Systems 33 (4), pp. 3611–3623. External Links: ISSN Cited by: §I, §IIA1.
 (2016Sep.) Micro synchrophasorbased intrusion detection in automated distribution systems: toward critical infrastructure security. IEEE Internet Computing 20 (5), pp. 18–27. External Links: Document, ISSN Cited by: §I.
 (2014) Adam: a method for stochastic optimization. External Links: 1412.6980 Cited by: §IIA2.
 (20071201) Challenges and trends in analyses of electric power quality measurement data. EURASIP Journal on Advances in Signal Processing 2007 (1), pp. 057985. External Links: ISSN 16876180, Document, Link Cited by: §I.
 (201805) Distribution synchrophasors: pairing big data with analytics to create actionable information. IEEE Power and Energy Magazine 16 (3), pp. 26–34. External Links: Document, ISSN Cited by: §I.
 (201707) Disruptive event classification using pmu data in distribution networks. In IEEE PES General Meeting, Cited by: §I.
 (1994) The three sigma rule. The American Statistician 48 (2), pp. 88–91. External Links: ISSN 00031305, Link Cited by: §IIA6.
 (202002) Anomaly detection in iotbased pir occupancy sensors to improve building energy efficiency. In Proc. of IEEE PES ISGT, Cited by: §I.
 (201911) Individual load model parameter estimation in distribution systems using load switching events. IEEE Trans. on Power Systems 34 (6), pp. 4652–4664. External Links: Document, ISSN Cited by: §I.
 (201905) A machine learning approach to event analysis in distribution feeders using distribution synchrophasors. In IEEE SGSMA, Cited by: §I.
 (201911) Situational awareness in distribution grid using micropmu data: a machine learning approach. IEEE Trans. on Smart Grid 10, pp. 6167–6177. Cited by: §I, §I, §I, §IIA1, §IIIA, §IIIB, §IIIC, TABLE I, §III.
 (201704) A datadriven analysis of capacitor bank operation at a distribution feeder using micropmu data. In Proc. of the IEEE PES ISGT, Vol. , pp. 1–5. External Links: Document, ISSN Cited by: §I.
 (201711) Precision microsynchrophasors for distribution systems: a summary of applications. IEEE Trans. on Smart Grid 8 (6), pp. 2926–2936. External Links: Document, ISSN Cited by: §I.
 (201711) Precision microsynchrophasors for distribution systems: a summary of applications. IEEE Trans. on Smart Grid 8 (6), pp. 2926–2936. External Links: Document, ISSN Cited by: §I.
 (2018Sep.) Partial knowledge datadriven event detection for power distribution networks. IEEE Trans. on Smart Grid 9 (5), pp. 5152–5162. External Links: Document, ISSN Cited by: §I, §I, §I.
 (201606) Distribution network event detection with ensembles of bundle classifiers. In IEEE PES General Meeting, pp. . Cited by: §I, §I, §I.