An inecient operation of the utility grid can be inferred from low power quality indexes. Under such conditions, reductions in the useful life of equipments and loads, grid instabilities, service interruptions and breakdowns can be expected, which would produce meaningful economic losses for the end-users as well as for the power supply company. In this context, it is useful to have a diagnosis tool able to identify the underlying cause of a given disturbance. This article proposes a one-step extreme learning machine-based method for the diagnosis of voltage dips detected on an electrical distribution grid. The proposed method was evaluated on the basis of synthetic data generated by the simulation of a real power grid. The performance of 10 hyperparameter combinations on Corresponding author Email address: ereynares@frsf.utn.edu.ar (E. Reynares), esangoi@frsf.utn.edu.ar (E. Sangoi), jrvega@frsf.utn.edu.ar (J.R. Vega), mcaliusc@frsf.utn.edu.ar (M.L. Caliusco), mrgalli@santafe-conicet.gov.ar (M.R. Galli) (Mar a Rosa Galli) Preprint submitted to IFAC Journal of Systems and Control September 18, 2019 the diagnosis of 20 di erent classes of voltage dips was assessed through two di erent strategies, i.e.: 1) a one-for-all approach, with a common classi er for all disturbance classes; and 2) a one-against-all approach, with a classi er per disturbance class. It was proven that strategy 2) has a better generalization ability and lower training and testing times. The obtained results suggest the potential of the proposed approach for power quality disturbance diagnosis, and open the challenge of formulating further hypotheses to be assessed. Keywords: power distribution line, power quality, voltage dip diagnosis, machine learning, arti cial neural network, extreme learning machine 1. Introduction The interest in power quality has increased among electric utilities and con- sumers in the last decades, as a result of the technological advancement and consumer awareness. Ten years ago, the duration and frequency of the discon- tinuity of electricity supply were the main power quality issues. Today, the 5 monitoring and control of variations in the frequency and voltage amplitude are equally important. The di usion of non-linear electric equipment contributes to the degradation of power quality, requiring more attention from the network operators (Decanini et al., 2011). Power quality problems are the consequences of the increasing use 10 of solid state switching devices, nonlinear and power electronically switched loads, unbalanced power systems, lighting controls, computer and data process- ing equipment as well as industrial plant recti ers and inverters. These elec- tronic loads cause quasi-static harmonic dynamic voltage distortions, inrush, pulse type current phenomenon with excessive harmonics and high distortion 15 (Manimala et al., 2012). At the same time, such devices are essential for the daily functioning of our society, being widely used in production, control, and communication processes as well as commercial, domestic and leisure devices. Low power quality causes inecient operation of electrical networks and infrastructures as well as the a ected loads, resulting in breakdowns and re- 20 2 ductions in the useful life of the equipment, malfunctions, instabilities, and interruptions; resulting in breakdowns and product life reductions can result in signi cant economic losses for the end-user and for the power company (Zhang et al., 2012; S anchez et al., 2013). A study carried out in Unites States of America (USA) showed that indus- 25 trial and digital business rms lost $45.7 billion per year due to power quality issues (Seymour & Horsley, 2008; Meher & Pradhan, 2010). A power quality survey carried out in European Union (EU) analyzed the economic consequences of unreliable electrical power for industrial and service sectors representing over 70% of the EU-25 economic output. The main purpose was to estimate costs 30 of wastage generated by inadequate power quality for those sectors for which electrical power is critical. Costs were classi ed according to the main power quality disturbances, i.e, (i) voltage dips and swells, (ii) short interruptions, (iii) long interruptions, (iv) harmonics, (v) surges and transients, and (vi) icker, unbalance, earthing and electromagnetic compatibility problems. The survey 35 presents two main conclusions. First, poor power quality generates a total loss of 150 billion euros annually in the EU-25. And second, voltage dips and short interruptions are the disturbances with the greatest negative economic impact, accounting for 57% of the total loss (Manson & Targosz, 2008). This situation has raised the need to monitor and improve the power trans- 40 mission and distribution networks. The ultimate goal of monitoring is to avoid electrical equipment damage and to identify the sources of power quality dis- turbances. But while the sources and causes of such disturbances must be identi ed and controlled before taking an appropriate mitigating action, the typical practices to diagnose them strongly rely on visual inspection of wave- 45 form disturbances and operator assessment. The analysis of such a volume of data is a dicult task - not to say almost impossible - even for experimented engineers (Khokhar et al., 2015b, 2017). Furthermore, it is rather dicult to determine the cause of a voltage dip, which usually gives rise to controversies between consumers and the electrical company. Within this perspective, it be- 50 comes evident the need for diagnostic tools able to identify possible causes of 3 voltage disturbances and to provide assistance in decision-making processes so as to de ne corrective actions (Decanini et al., 2011). This requires to develop techniques for automatic disturbance identi cation, to be applied directly or by means of feature extraction and pattern recognition. 55 Several surveys reporting the application of signal processing and arti cial intelligence techniques for the (semi) automatic detection, classi cation and diagnosis of power quality disturbances can be found in the literature (Strack et al., 2018; Montoya et al., 2016; Khokhar et al., 2015b; Mahela et al., 2015; Saini & Kapoor, 2012; Granados-Lieberman et al., 2011; Saxena et al., 2010). 60 These proposals can be generally divided into two groups. The rst group involves the approaches aimed to classify the type of distur- bance - e.g., voltage sags/swells, interruption, etc. A Support Vector Machine (SVM) approach combined with Discrete Wavelet Transform (DWT) to classify disturbances is explored in Ekici (2009). In Meher & Pradhan (2010), Wavelet 65 Transform (WT) is used to extract the features of disturbances, which are then classi ed by means of a Fuzzy Product Aggregation Reasoning Rule (FPARR). Salem et al. (2010) presents a rule-based system for intelligent classi cation of disturbances using the Stockwell-Transform (S-Transform) features. Wang & Tseng (2011) classi es disturbances by means of DWT and Extension Ge- 70 netic Algorithm (EGA). Zhang et al. (2011) applies Discrete Fourier Transform (DFT) and a Rule-Based Decision Tree (RBDT). Decanini et al. (2011) shows the use of DWT, MultiResolution Analysis (MRA), Entropy Norm (EN), and a Fuzzy Adaptive Resonance Theory Neural Network to classify the disturbances. Pires et al. (2011) presents an approach based on Principal Component Anal- 75 ysis (PCA) and Neuro-Fuzzy based automatic classi cation of disturbances. A classi cation approach based on the S-Transform and a Probabilistic Neural Net- work (PNN) is proposed in Huang et al. (2012b). Manimala et al. (2012) classify the disturbances using Wavelet Packet Transform (WPT) and SVM. S anchez et al. (2013) describes a Genetic Algorithm (GA) that optimizes the S-Transform 80 for analysis and classi cation of the disturbances. Ozgonenel et al. (2013) as- sesses the performance of a disturbance classi cation approach based on En- 4 semble Empirical Mode Decomposition (EEMD) and SVM for feature extrac- tion and classi cation. Shareef et al. (2013) presents an image processing-based technique to detect disturbances. Biswal & Dash (2013) introduces variants of S- 85 Transform algorithm and Decision Tree (DT) to select optimal set of features for extraction of the decision rules, which are then used for identi cation of distur- bances. In Hajian & Foroud (2014), Hyperbolic S-Transform (HST), DWT and Orthogonal Forward Selection (OFS) have been used for extraction and selection of features, comparing the performance of SVM, PNN, and K-Nearest Neighbor 90 (K-NN) classi ers. Biswal et al. (2014) proposes an Empirical-Mode Decompo- sition (EMD) and Hilbert transform (HT)-based method for disturbance clas- si cation. Liu et al. (2015) uses a Rank-Wavelet SVM method combined with a EEMD process for the classi cation task. Khokhar et al. (2015a) presents an approach using DWT and Modular Probabilistic Neural Network (MPNN). 95 Kanirajan & Kumar (2015) presents the application WT combined with Radial Basis Function Neural Network and Particle Swarm Optimization (RBFNN- PSO) algorithms. A disturbance feature selection and recognition method based on Optimal Multi-resolution Fast S-Transform (OMFST) and Classi cation and Regression Tree (CART) algorithm is proposed in Huang et al. (2016). Reddy & 100 Sodhi (2016) uses a rule-based S-Transform for feature extraction and Adaptive Boost (AdaBoost) as classi er. Strack et al. (2016) assesses a logical classi er, a fuzzy classi er, and a MultiLayer Perceptron (MLP) for voltage disturbances classi cation. A method using WPT and Extreme Learning Machines (ELM) has been proposed in Naik et al. (2016). Disturbances are classi ed in Sahani & 105 Dash (2018); Sahani et al. (2016c,b,a) by using WT, Hilbert-Transform (HT), and some variations of ELM. Nayak et al. (2016) presents an ELM and a mod- i ed Teaching-Learning-Based Optimization (TLBO) approach for the Local Linear Radial Basis Function Neural Network (LLRBFNN) model to perform the classi cation. In Zhang et al. (2016), Modi ed S-Transform (MST) and ELM 110 algorithms are applied to disturbance classi cation. Khokhar et al. (2017) pro- poses DWT for feature extraction and PNN-based Arti cial Bee Colony (PNN- ABC) as classi er. Ma et al. (2017) introduces a Deep Learning-based classi er, 5 known as Stacked AutoEncoder (SAE). Jaen-Cuellar et al. (2017) focuses on the use of the micro-genetic algorithms (MGA), applying a one-step approach that 115 directly performs feature extraction and classi cation. Mahela & Shaik (2017) presents a method based on S-Transform and Fuzzy C-means clustering initial- ized by DT. A Variational Mode Decomposition (VMD) aided Fischer linear Discriminant Analysis (FDA)-based feature selection with reduced kernel ELM has been used as classi er in Chakravorti & Dash (2018). De & Debnath (2018) 120 presents a fuzzy-based method using cross-correlation technique for detection and classi cation of disturbances. An approach based on Tunable-Q Wavelet Transform (TQWT) and a dual Multiclass Support Vector Machines (MSVM) has been proposed for disturbance detection in Thirumala et al. (2018). Chen et al. (2018) proposes an approach based on dual strong tracking lters (STFs) 125 and rulebased ELM for disturbance detection and classi cation. Jamali et al. (2018) presents the use of the Sequential Forward Selection (SFS), GA and max- imum Relevance Minimum Redundancy (mRMR) algorithms for the selection of disturbance features, which are then input to the most popular models - e.g., Linear Discriminant Analysis (LDA), Naive Bayes, SVM, PNN, MLP, K-NN, etc 130 - for the classi cation. An ELM classi er coupled with DWT-Entropy and his- togram methods for disturbance classi cation is proposed in Ucar et al. (2018). A deep learning-based compressed sensing and sparse autoencoder approach is used in Liu et al. (2019) for classi cation of single and complex disturbances. The goal of the second group of techniques is to diagnose the disturbances 135 by identifying their underlying causes. One of the main attempts in this di- rection can be found in Bollen et al. (2007). It analyzes a deterministic and a statistical classi cation approach. The work distinguishes ve classes of distur- bances on the synthetic dataset: voltage dips with drop in one phase, voltage dips with identical drop in two phases, voltage dips due to three phase faults, 140 voltage dips with a di erent drop in two phases, and voltage disturbances due to transformer energizing. Eri sti & Demir (2010) presents a Wavelet Multi- Resolution Analysis (WMRA) and SVM based approach for the diagnosis of simulated phase-to-ground faults, phase-to-phase faults, three-phase fault, load 6 switching, capacitor switching and transformer energizing events. In Eri sti & 145 Demir (2012), WT is used at the feature extraction stage, while the disturbances are classi ed by means of SVM and diagnosed by using a DT algorithm. Real power system event data is used to evaluate the performance of the strategy, which considers the following disturbances: faults, self-extinguishing faults, line energizing, interruption, and transformer energizing. A feature selection tech- 150 nique for the diagnosis of a dataset of real disturbances is proposed in Eri sti et al. (2013). A data set feature vector is obtained by applying multi-resolution analysis (MRA) and k-Means based Apriori algorithm feature selection is used. The obtained optimal feature vector is the input a Least Squares Support Vec- tor Machine (LS-SVM) classi er. A S-Transform and ELM based diagnosis 155 approach is proposed in Eri sti et al. (2014) and its performance is assessed on noisy conditions over real and synthetic datasets. The previous paragraphs show the large number of existing initiatives re- garding the detection, classi cation and diagnosis of power quality disturbances. However, most of them classify disturbances according to their types - e.g.: 160 dip, sag, interruption, etc. - instead of doing it according to their underly- ing causes. Although such approach is useful for the development of methods, the availability of tools for classifying disturbances according to the event that generated them has a greater practical value. At the same time, the identi ca- tion of the underlying causes of disturbances is a more dicult and challenging 165 task. It requires not only signal analysis but also the information of power network con guration or settings, comprising signal analysis knowledge, power system knowledge, and information on power network con gurations and set- tings (Bollen et al., 2007). The aforementioned issues are addressed in this article by performing a set 170 of experiments aimed at assessing the feasibility of an arti cial intelligence tech- nique for the diagnosis of voltage dips. The proposal is rooted on the one-step application of the ELM algorithm for single-hidden layer feed-forward neural networks. The one-step application refers to the lack of any segmentation and feature extraction pre-processing stage: the three-phase voltage waveforms are 175 7 directly shown to the classi er to identify the underlying cause of the observed disturbance. The classi cation task is performed over synthetic data generated by the simulation of a real power distribution grid, assessing the performance of 10 hyperparameter combinations of the technique. The experiments consider 20 di erent types of voltage dips. They are divided into three main groups: fault- 180 induced dips, self-extinguishing faults, and motor starting events. Eleven types of dips were simulated for fault-induced dips, three types for self-extinguishing faults, and six types for motor starting events. 1,000 dips were simulated for each type of dip under di erent conditions of fault resistance, fault duration, and time evolution of the current. 185 The rest of the work is organized as follows. Section 2.1 and Section 2.2 introduces the power quality concepts and the Extreme Learning Machine tech- nique, respectively. The experiment dataset is depicted in Section 3 and the experiment setup is detailed in Section 4. The results and the performance metrics applied in their evaluation are shown in Section 5. Insights about the 190 work and the related literature are presented in Section 6. Conclusions and outlook on future research are shown in Section 7. 2. Background 2.1. Power quality Di erent and sometimes con ictive de nitions of Power Quality (PQ) can 195 be found. IEEE states that \PQ refers to a wide variety of electromagnetic phenomena that characterize the voltage and current at a given time and at a given location on the power system" (IEEE, 2009). IEC de nes PQ as \[the set of] characteristics of the electricity at a given point on an electrical system, evaluated against a set of reference technical parameters" (IEC, 2003). 200 This work adheres to the de nition most widely considered in the bibliog- raphy: PQ comprises voltage and current quality, which are concerned with deviations of the actual voltage/current from the ideal voltage/current. Ideal voltage/current is a sinusoidal voltage/current waveform with constant ampli- 8 tude and constant frequency of a given nominal value. These statements allow 205 the simple and straightforward de nition of Power Quality Disturbance (PQD) as any deviation of voltage or current from the ideal one. A disturbance is a voltage disturbance or a current disturbance, but it is often not possible to dis- tinguish them given that any change in current is accompanied by a change in voltage and viceversa (Bollen & Gu, 2006). 210 Voltage disturbances are generally categorized according to their duration and magnitude, considering short and long interruptions, short-duration over- voltages and undervoltages, and long-duration overvoltages and undervoltages. A voltage disturbance is caused by a sudden current increase at a speci c point of the electrical grid and along a speci ed period. The main cause of the overcur- 215 rents are faults, originated from short-circuits raised by insulation breakdown, switching operations or atmospheric discharges. Switching of large shunt ca- pacitor banks and starting of large loads (e.g., motors), can also produce large changes in current similar in e ect to those of short-circuit states. Supply sys- tems are equipped with protective devices to disconnect the short circuit from 220 the source of energy, which allows the almost immediate recovery of the voltage at every point except the disconnected ones. Some types of faults are self- clearing: the short circuit disappears and the voltage recovers before the line disconnection can take place (Bagdadioglu & Senyucel, 2010; Hanzelka, 2008; Bollen & Gu, 2006). In consequence, the depth and duration of a disturbance 225 perceived by a given user is strongly related to the cause of the overcurrent and the point of the grid where it occurs. This work focuses on the disturbances known as \voltage dips" or \voltage sags". A voltage dip/sag is a sudden reduction of the voltage at a particular point of an electricity supply system below a speci ed dip threshold within a 230 short time period, followed by its recovery after a brief interval. The threshold value is the voltage r.m.s value de ned in order to determine the start and end of a voltage dip. IEEE de nes voltage sag as a decrease of 10 - 90% in the rms voltage at the power frequency for duration of half cycle to 1 minute (IEEE, 2009). IEC de nes a voltage dip as a sudden reduction in the supply voltage 235 9 to a value between 90% and 1% of the nominal voltage followed by a recovery between 10 milliseconds and 1 minute. In polyphase systems it is assumed that a three-phase dip starts when the voltage in the rst disturbed phase falls below the threshold and ends when voltages in all phases are equal to or above the threshold. The duration of a voltage dip depends on the speci ed 240 threshold value. The rest of this work will use the term voltage dip to refer to both concepts, although some details in terms of amplitude and duration di er slightly(IEC, 2004). 2.2. Extreme Learning Machine (ELM) ELM is a relatively new learning algorithm for Single-hidden Layer Feed- 245 forward Neural networks (SLFNs), which provides good generalization perfor- mance at extremely fast learning speed -in most cases thousands of times faster than conventional learning techniques (Huang et al., 2006b,a). Due to its re- markable eciency, simplicity, and impressive generalization performance, ELM has been applied in a variety of domains, such as biomedical engineering, com- 250 puter vision, system identi cation, robotics, and power systems control and operation (Zhang et al., 2018; Das et al., 2018; Lin et al., 2017; Bequ e & Less- mann, 2017; Rubiolo et al., 2018; Huang et al., 2015; Song & Zhang, 2013; Avci, 2013; Avci & Coteli, 2012). ELM randomly chooses hidden nodes and analytically determines the output 255 weights of SLFNs. Thus, the only free parameters that need to be learned are the weights between the hidden layer and the output layer of the neural model. ForLarbitrary distinct samples ( xl;yl), where xl= [xl1;xl2; :::;xlN]T2RN is the l-th input vector and yl= [yl1;yl2; :::;ylM]T2RMis the l-th target vec- tor, a SLFN with Phidden nodes and activation function f() is mathematically modeled as: PX i=1Bif(wT ixl+bi) =ol (1) whereBiis the weight vector connecting the i-th hidden node and the output nodes, wi= [wi1; wi2; :::; w iN]Tis the weight vector connecting the i-th hidden 10 node and the input nodes, biis the threshold of the i-th hidden node, and olis 260 the output value of the l-th node. The SLFN can approximate these Lsamples with zero error asP lkol- ylk=0, for which there must exist ^Bi,^wi, and ^biso that: PX i=1^Bif(^wT ixl+^bi) =yl (2) The above Lequations can be compactly written as: HB=Y (3) where H=2 66664f(^wT 1x1+^b1): : : f (^wT Px1+^bP) ......... f(^wT 1xL+^b1): : : f (^wT PxL+^bP)3 77775(4) B= [^BT 1; :::;^BT P]T; (5) Y= [yT 1; :::;yT L]T(6) His the hidden layer matrix of the neural network, and its i-th column is thei-th hidden node output with respect to inputs x1;x2; :::;xL. The output connection weights can be obtained by solving minBkHB-Yk. Then: ^B=HyY (7) where Hyis the Moore-Penrose generalized matrix inverse of the hidden layer matrix H. The ELM algorithm can be summarized as follows: a) Inputs: 265 L-size training set ( xl;yl)l=1;2;:::;L, where xl2RNandyl2RM, 11 the number Pof hidden nodes, and the activation function f(). b) Steps: Select arbitrary values for the input weights wi2RNand thresholds 270 bi2Rfor the Phidden neurons. Calculate the hidden layer matrix Hof the SLFN. Obtain the optimal ^Bby solving the ^B=HyYequation c) Output: For any input vector xl2RN, the output value olis obtained through the formulaPP i=1^Bif(^wT ixl+^bi). 275 As proved in Huang et al. (2006b), if the f() activation function of the hidden layer is in nitely di erentiable and the number Pof hidden nodes is less than or equal to the number Lof samples, then the input weights wi2RNand thresholds bi2Rcan be randomly selected and the SLFN approximates the training data with "error, i.e.:kHB-Yk". 280 After the input weights and the hidden layer biases are chosen randomly, the SLFNs is a linear system and the output weights are analytically determined through generalized inverse operation of the hidden layer output matrices. In this way, ELM obtains the global optimal solution by tting ^B, avoiding to fall into local optimums. 285 Di erent from traditional iterative learning algorithms, ELM not only reach the smallest training error but also the smallest norm of weights. According to the Barlett (1998) study on the generalization performance of feedforward neural networks reaching smaller training error, the smaller the norm of weights is, the better generalization performance the networks tend to have. Thus, 290 ELM obtains not only the minimum square training error but also the best generalization scores on new samples (Huang et al., 2006a,b). 12 3. Experimental dataset Diagnosis of voltage disturbances is performed by classifying voltage dips ac- cording to their underlying causes. The classi cation task is performed over syn- 295 thetic data generated by the simulation of a real power distribution grid, assess- ing the performance of several hyperparameter combinations of the SLFN/ELM based technique. The grid is placed on the outskirts of the city of Santa Fe (Argentina), and supplies electricity to a populous coastal neighborhood (named Alto Verde ) and a scienti c research and industrial installations cam- 300 pus ( PTLC )1. The distribution grid has an aerial distributor of 13.2 kV in a horizontal coplanar arrangement that starts in the transformer station and ends at PTLC, with intermediate derivation that supplies electricity to the Alto Verde neighborhood. The lines are made of aluminum conductor steel reinforced (ACSR) of 50=8mm2with the following parameters: 305 R0=0:7406 ohm =km,X0=1:624 ohm =km, for homopolar impedance, and R1=0:5962 ohm =km,X1=0:3555 ohm =km, for direct sequence impedance. The electricity source is a power substation of 132 kV, with a single/three- phase short-circuit power of 3,500/3,100 MVA. A three-winding transformer 310 (30/30/30 MVA) is used to reduce the high-voltage to 13.2 kV in the feeder of interest, which also has a neutral grounding reactor with R=11:80 ohm and X=2:00 ohm . Figure 1 depicts the grid. The distribution grid was modeled with ATP/EMTP and ATPDraw2soft- ware for the simulation of 20,000 voltage dips. Each simulation lasts 500 millisec- 315 onds, with a sampling time of 1 millisecond and a discrete simulation interval of 10 microseconds. The simulation consisted in producing overcurrents at a speci c location of the grid - the fault point - and measuring the instantaneous 1Parque Tecnol ogico Litoral Centro (PTLC). More information on http://www.ptlc.org. ar/ 2More information on http://www.emtp.org/ 13 Figure 1: Electric grid model used in the experiments. voltages on another location - the sensitive load -. An intermediate point of the derivation line to the neighborhood was stated as the fault point, while PTLC 320 represents the sensitive load. Both location points can be identi ed in Figure 1. This article considers 20 di erent types of voltage dips. They are divided into three main groups: fault-induced dips, self-extinguishing faults, and mo- tor starting events. Eleven types of dips were simulated for fault-induced dips, three types for self-extinguishing faults, and six types for motor starting events. 325 1,000 dips were simulated for each type of dip under di erent conditions of fault resistance, fault duration, and time evolution of the current, i.e.: dura- tion time and fault impedance values were randomly selected from zero-mean Gaussian distributions. Table 1 presents the details of the voltage dip types and the nomenclature used in the context of the classi cation problem. Finally, 330 it remains to be noted that the simulations considers peak load demands and the loads were modeled as constant impedances, according to the parameters depicted in Table 2. Figure 2(a)-Figure 8(b) present the three-phase voltage waveforms of a sim- ulation of each type of voltage dip analyzed. The vertical axis shows the phase- 335 to-ground voltage per unit. Although each simulation last 500 milliseconds, the horizontal axis (time axis) length was shortened to highlight the window where the disturbance and the fault-clearing happens. 14 Table 1: Types of voltage dips simulated, and their nomenclature for the classi cation task. Class Voltage dip type description C1 Single line-to-ground fault. Three-phase fault-clearing. Linear fault resistance. C2Single line-to-ground fault. Single-phase fault-clearing. Serial nonlinear fault resistance. C3Single line-to-ground fault. Single-phase fault-clearing. Parallel nonlinear fault resistance. C4Double line-to-ground faults. Three-phase fault-clearing. Always the same two phases for each simulation. C5Double line-to-ground fault. Tree-phase fault-clearing. Two di erent phases for each simulation. C6 Three-phase fault. Three-phase fault-clearing. C7Simultaneous single line-to-ground fault on all phases. Independent single fault-clearing. Di erent fault resistances and di erent clearing times for each phase. C8Simultaneous single line-to-ground fault on all phases. Independent single fault-clearing. The same fault resistances but di erent clearing times for each phase. C9 Self-extinguishing single line-to-ground fault. Nonlinear fault resistance. C10 Self-extinguishing line-to-line fault. Linear fault resistance. C11 Self-extinguishing three-phase fault. Linear fault resistance. C12Simultaneous line-to-ground fault on all phases. Electric arc with fault ionization. C13Simultaneous line-to-ground fault on all phases. Electric arc with fault deionization. C14Simultaneous line-to-ground fault on all phases. Electric arc with random resistance variation. C15 Balanced three-phase starting current ( 180A ). C16 Unbalanced three-phase starting current ( 300A ). C17Unbalanced three-phase starting current ( 300A ). Di erent current variation for each phase. C18 Balanced three-phase starting current ( 300A ). C19 Single-phase starting current ( 120A ). C20 Single-phase starting current on two phases simultaneously ( 120A ). 15 Table 2: Electric parameters for modeling demands as constant impedance loads Load 1 2 3 4 5 6 7 R [ohm] 8.92 134.46 313.74 235.31 470.61 313.74 941.22 X [ohm] 2.93 44.19 103.12 77.34 154.68 103.12 309.36 (a) Single line-to-ground fault. Three-phase fault-clearing. Linear fault resistance. (b) Single line-to-ground fault. Single-phase fault-clearing. Serial nonlinear fault resis- tance. (c) Single line-to-ground fault. Single-phase fault-clearing. Parallel nonlinear fault resistance. Figure 2: The three-phase voltage waveforms of: (a) a C1 dip type example, (b) a C2 dip type example, and (c) a C3 dip type example. 16 (a) Double line-to-ground faults. Three-phase fault-clearing. Always the same two phases for each simulation. (b) Double line-to-ground faults with three-phase fault-clearing. Two di erent phases for each simulation. (c) Three-phase faults. Three-phase fault-clearing Figure 3: The three-phase voltage waveforms of: (a) a C4 dip type example, (b) a C5 dip type example, and (c) a C6 dip type example. 4. Experimental setup The SLFN/ELM based approach is evaluated through two strategies aimed 340 at testing di erent combinations of the following hyperparameters: (i) the num- ber of hidden neurons of the SLFN, and (ii) the activation function. Both strategies apply the single classi cation method to state one correct class for 17 (a) Simultaneous single line-to-ground fault on all phases. Independent single fault- clearing. Di erent fault resistances and di erent clearing times for each phase. (b) Simultaneous single line-to-ground fault on all phases. Independent single fault- clearing. The same fault resistances but di erent clearing times for each phase. Figure 4: The three-phase voltage waveforms of: (a) a C7 dip type example, and (b) a C8 dip type example. each sample, (ii) and the Leave-One-Out Cross-Validation (LOOCV) procedure to select the model structure with the optimal number of hidden neurons. The 345 LOOCV procedure is computed by the Predicted Residual Error Sum of Squares (PRESS) statistic (Raschka, 2018; Akusok et al., 2015). Strategy 1 applies a one-for-all approach. A single classi er is trained to classify the 20,000 simulated voltage dips according to the 20 classes, testing 9 di erent combinations of the hyperparameters: 1,500 ( 1.5k); 3,000 ( 3k); and 350 5,000 ( 5k) neurons in the hidden layer, applying sigmoid activation function (sigm), hyperbolic tangent activation function ( tanh), or RBF activation func- tion with L1norm ( rb1). This strategy applies the one-hot encoding approach by de ning an output matrix of Boolean values, showing the class - i.e., the un- derlying cause - of a given voltage dip. Therefore, an output matrix of 400,000 355 18 (a) Self-extinguishing single line-to-ground fault. Nonlinear fault resistance. (b) Self-extinguishing line-to-line fault. Linear fault resistance. (c) Self-extinguishing three-phase fault with linear fault resistance. Figure 5: The three-phase voltage waveforms of: (a) a C9 dip type example, (b) a C10 dip type example, and (c) a C11 dip type example. cells is obtained: 20,000 rows for the voltage dips and 20 columns for the classes. Strategy 2 applies a one-against-all approach. A single classi er is trained per class, the samples of the class are positive samples and the remaining ones are negatives. In consequence, 20 SLFN/ELMs are de ned to classify the 20,000 simulated voltage dips according to the 20 adopted classes. Each SLFN/ELM 360 is trained to detect a speci c class as the cause of a given voltage dip. This 19 (a) Simultaneous line-to-ground fault on all phases. Electric arc with fault ionization. (b) Simultaneous line-to-ground fault on all phases. Electric arc with fault deionization. (c) Simultaneous line-to-ground fault on all phases. Electric arc with random resistance variation. Figure 6: The three-phase voltage waveforms of: (a) a C12 dip type example, (b) a C13 dip type example, and (c) a C14 dip type example. experiment comprises just one setting of the hyperparameters: 750 neurons applying tanh. This strategy also applies the one-hot encoding approach, but each of the 20 SLFN/ELMs must learn the relationship between the voltage dips and a single speci c class. Then, each classi er de nes an output matrix 365 of Boolean values showing whether a given voltage dip is caused by the class for which the model was trained. Therefore, it is obtained 20 output matrices of 20 40,000 cells each one: 20,000 rows for the voltage dips and 2 columns showing whether they were/they were not produced by the speci c class. In this way, the diagnosis of voltage dips is performed by presenting each 370 simulation -comprising 500 milliseconds of the three-phase voltage waveforms- to the di erent settings of the SFLM/ELM based technique. The voltage wave- forms and the class label representing their underlying causes are shown to the classi ers, so that the model can learn the relationship between them. For all settings of both experiments, inputs comprise 500 samples of instantaneous 375 voltages at each phase. As can be noted in Section 2, although ELM originally belongs to the set of regression methods it can be easily adapted for classi ca- tion problems (Huang et al., 2012a). For the single classi cation method applied in this work, the index of the output node with the highest output indicates the predicted label of the input. 380 Strategy 1 and Strategy 2 are implemented using the Python3HP-ELM library. HP-ELM is a high performance neural network toolbox for solving large problems, which supports datasets of any size and GPU acceleration with modest memory consumption and fast non-iterative optimization Akusok et al. (2015)4385 5. Results The performance of the approach is assessed by means of three widely used classi cation task metrics: precision, recall, and F1 score. Precision (P) is de ned as tp=(tp+fp). Recall (R) is de ned as tp=(tp+fn). In both expressions, tpis the number of true positives, fpis the number of false 390 positives, and fnis the number of false negatives. Intuitively, P is the ability of the classi er to not label as positive a sample that is negative, while R measures its ability to nd the positive samples. 3More information on https://www.python.org/ 4Python implementation of the experiments can be found in https://gitlab.com/emireys/elm4vdc-experiments.git 21 F1 score (F1) is de ned as 2 (PR)=(P+R), and represents a weighted average of precision and recall metrics where the relative contribution of both 395 metrics to F1 score are equal. As it can be inferred from the previous math- ematical expressions, the scores for all these metrics range from 1 (best) to 0 (worse). Since F1 score can be used as a joint representation of precision and recall metrics, the experiment results will be mainly assessed by analyzing Table 3. 400 It shows the average values of F1 scores per class over 100 runs of the 10 dif- ferent combinations of hyperparameters considered in the experiments. The best values for each class along all proposed hyperparameter combinations are highlighted in grey color. The last two rows of the table show the average and standard deviation values for each hyperparameter combination and for all 405 classes under study. Evenly, the best average and standard deviation values are highlighted in grey color. By analyzing the rows, it is possible to notice those classes that are easily identi able by means of any of the proposed hyperparameter combinations. Speci cally, C1,C2,C3,C4,C5,C9,C10,C11,C15,C16,C19, and C20classes 410 have F1 scores close to 1, independently of the hyperparameter combination. For C6class, only the hyperparameter combination comprising 1,500 neurons in the hidden layer with rb1activation function has a F1 score lower than 0.91, while the remaining combinations show F1 scores close to 1. The same characteristics are recognizable in F1 scores for C12class, where only the hyperparameter 415 combinations comprising 1,500 and 5,000 neurons in the hidden layer with rb1 activation function has a F1 score lower than 0.92. Instead, the di erent hyperparameter combinations have quite disperse F1 scores - i.e., between 0.60 and 0.87 - for C7class. A similar dispersion can be seen for C8andC17classes, where F1 scores fall in the [0.63; 0.87] and [0.67; 420 0.82] ranges, respectively. ForC13class, it is observed that only those hyperparameter combinations with the rb1activation function have F1 scores that do not exceed 0.81, while the other combinations have values at least 0.91. 22 Table 3: Average values of the F1 score per class over 100 runs of each hyperparameters combination. F1 score 1.5k sigm3k sigm5k sigm1.5k tanh3k tanh5k tanh1.5k rb13k rb15k rb1750 tanh C1 0.98 0.98 0.98 0.98 0.98 0.99 0.97 0.98 0.98 0.98 C2 1.00 1.00 1.00 1.00 1.00 1.00 0.96 0.97 0.97 0.99 C3 0.98 0.98 0.98 0.98 0.98 0.99 0.97 0.98 0.98 0.98 C4 1.00 1.00 1.00 1.00 1.00 1.00 0.96 0.97 0.97 1.00 C5 1.00 1.00 1.00 1.00 1.00 1.00 0.96 0.97 0.97 1.00 C6 0.97 0.98 0.98 0.97 0.98 0.98 0.89 0.91 0.91 0.97 C7 0.82 0.80 0.74 0.82 0.82 0.78 0.62 0.64 0.60 0.87 C8 0.83 0.82 0.75 0.83 0.83 0.79 0.66 0.67 0.63 0.87 C9 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 C10 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 C11 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 C12 0.97 0.97 0.94 0.98 0.98 0.97 0.90 0.92 0.90 0.99 C13 0.98 0.97 0.91 0.98 0.98 0.96 0.81 0.80 0.74 0.99 C14 0.92 0.92 0.85 0.93 0.93 0.90 0.76 0.79 0.75 0.89 C15 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 C16 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 C17 0.67 0.70 0.72 0.71 0.74 0.75 0.78 0.82 0.82 0.81 C18 0.80 0.81 0.81 0.82 0.83 0.83 0.84 0.86 0.85 0.90 C19 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 C20 1.00 0.99 0.98 1.00 1.00 0.99 0.94 0.93 0.91 1.00 avg. 0.95 0.95 0.93 0.95 0.95 0.95 0.90 0.91 0.90 0.96 std. 0.09 0.09 0.10 0.08 0.08 0.08 0.12 0.11 0.12 0.06 TheC14class shows F1 scores of at least 0.90 for the hyperparameters com- 425 binations comprising 1,500 and 3000 neurons with sigm activation function, and thetanh activation function with any number of neurons. Remaining combina- tions have F1 scores that do not exceed 0.89. All hyperparameter combinations for C18class have F1 scores in the [0.80, 0.90] range. 430 The analysis of the columns of Table 3 helps to identify the hyperparameter combination comprising 750 neurons in the hidden layer with tanh activation function as the best option for the classi cation task under study. This conclu- sion is based on 3 criteria: 1. It gets the best F1 score more times than any other combination. Specif- 435 23 ically, in 14 of 20 classes. 2. It gets the best average F1 score along the 20 classes, as shown in the penultimate row of the table. 3. It presents the lowest dispersion of F1 scores, as shown in the last row of the table. 440 The analysis of training and test times strengthen the choosing of this option. Fig. 9(a) and Fig. 9(b) compare the average training and test times over 100 runs of the 10 hyperparameters combinations. It is evident that at training and testing stages the option comprising 750 neurons in the hidden layer with tanh activation function is much faster than the remaining alternatives. 445 This hyperparameter combination applies the one-against-all approach. I.e., a single classi er is trained per class, where the samples of the class are positive samples and the remaining ones are negative. In consequence, Fig. 9(a) and Fig. 9(b) show the average training/test time over 100 runs of the 20 trained models comprising 750 neurons and tanh activation function. For the remaining 450 options -which apply the one-for-all approach-, the average training and test times over 100 runs of the single classi er are shown. The raw values of the training/testing times are presented as additional material to this article, showing that the aforementioned hyperparameter com- bination is up to two orders of magnitude faster than the remaining ones. Sim- 455 ulation model of the electrical grid, dataset with 20,000 simulated voltage dips, and performance metrics reports are available on [dataset] Reynares (2019). 6. Discussion Although there is a large number of initiatives regarding the detection, clas- si cation and diagnosis of PQDs, most of them classify disturbances according 460 to their types instead of doing it according to their underlying causes. The di- agnosis approach is a dicult and challenging task, but it also comprises greater 24 practical value. Eri sti & Demir (2010, 2012); Eri sti et al. (2013) and Eri sti et al. (2014) depict a set of proposals in this direction. Eri sti & Demir (2010) classi es 1,200 synthetic PQDs simulated on the 465 WECC 9-bus system model according to 6 causes: phase-to-ground fault, phase- to-phase fault, three-phase fault, load switching, capacitor switching, and trans- former energizing. Eri sti & Demir (2012) and Eri sti et al. (2013) classify a dataset comprising 538 disturbances monitored in a real power system into 5 causes: fault, self-extinguishing fault, line energizing, non-fault interruption, 470 and transformer energizing. In Eri sti et al. (2014),the approach proposes to classify a mixture of 5,458 real and synthetic disturbances, considering the same 5 causes of the aforementioned works. All these proposals also share the same general structure. They comprise (i) the pre-processing stage, (ii) the feature extraction stage, and (iii) the clas- 475 si cation stage. At the pre-processing stage, normalization and segmentation task are performed. Segmentation decreases the size of data under analysis and enables the obtention of its distinctive features. Normalization converts voltage waveform values to a relative scale - i.e., per unit. The feature extraction stage allows to recognize and prioritize the distinctive features of the dataset. Just 480 after having completed all these activities, it is possible to apply some classi - cation procedure of the disturbances. This structure increases the complexity of the proposed solutions, and entails greater computational and time resources, both at the design and execution stage. The structure proposed in this article follows the opposite approach. No 485 normalization, segmentation, nor feature extraction stage. The diagnosis task is performed by presenting the three-phase voltage waveforms directly to the ELM based classi er, without intermediate steps. This allows to reduce the processing loads and simpli es the overall technique. The strategy not only allows to diagnose disturbances according to a reduced set of generic causes, 490 it focuses on the diagnosis of voltage dips assessing 20 slightly di erent failure scenarios under di erent operative conditions of a real power network. Despite the lack of the normalization, segmentation, and feature extraction 25 stages, the proposed technique achieves high levels of performance. Speci cally, the technique performs almost perfect classi cations in at least half of the causes 495 considered, and achieves an average performance of 96% on the full dataset. The experiment setup allows to rule out the possibility of achieving these results just by chance. Two di erent strategies and ten hyperparameter combinations are considered, running a hundred repetitions of each possible option by randomly varying the elements that constitute the training and test sets. The classi cation 500 task performance is assessed by means of three widely used classi cation task metrics. The training and test times are also considered as criteria to select the best option for the classi cation task under study. Unlike many published works, and in order to facilitate the eventual repro- duction of experiments, this article provides the ATP/EMTP power network 505 model and all the details about the failure scenarios under di erent operative conditions, the dataset with the simulated voltage dips, the source code of the experiments, and their performance metrics. The software frameworks, libraries, and tools being used for performing the experiments are open sourced and freely accessible. Publishing of these resources enables the experiments of this work to 510 be fully reproducible. The simulation model of the power network, the dataset with 20,000 simulated voltage dips, and performance metrics reports are avail- able on [dataset] Reynares (2019)5. 7. Conclusions This work shows the potential of a SLFN/ELM based approach for the di- 515 agnosis of voltage dips on power distribution lines by identifying the causes of the disturbances. Previous works have shown the potential of ELMs as clas- si ers, and this article empirically con rm such insight by assessing several performance dimensions of the algorithm on an extensive set of experiments. The experiments also allow to recognize the strategy that presents the best 520 5The dataset and Python implementation of the experiments can be found on https: //gitlab.com/emireys/elm4vdc-experiments 26 predictive performance, and at the same time, it is the most attractive from a pragmatic point of view. I.e., the one-against-all strategy is a scalable approach, and the 750- tanh hyperparameter combination turns out a simple model with high predictive scores at short training and test times. Scalability is an extremely important issue since in a real environment new 525 causes for disturbances could be identi ed and the diagnostic technique should be able to incorporate them into their internal models. The one-against-all approach enables to extend such models by building SLFN/ELMs speci cally trained to diagnose the disturbances according to the newly identi ed cause. The re-training of the previous models is required in this case, but as it was 530 previously shown, this is quite fast. In contrast, the gradual incorporation of new knowledge is not possible when the one-for-all strategy is applied. It requires the building and training of a full new model from scratch to consider new causes for disturbances, and this is quite costly in terms of time and e ort. It is important to mention that the hyperparameters settings assessed in 535 this works also respond to the intention to contrast the performance of the one- for-all (Strategy 1) and one-against-all (Strategy 2) approaches. According to that intention, Strategy 2 only evaluates the half of the minimum number of hidden neurons considered by Strategy 1 and applies only one of the available activation funcions. However, despite this drastic reduction in the complexity 540 of the model, Strategy 2 is presented as the best option for the task under study in terms of generalization performance, training times and testing times. These results made evident the impact of each approach on the performance metrics, architectural features -in terms of scalability-, and extensibility -through gradual incorporation of new knowledge- of the overall solution. 545 It is known that a laboratory experiment su ers from a certain lack of re- alism, but is also recognizable that a eld study that involves the monitoring and diagnosis of voltage events is quite expensive both from a technical and legal point of view. Even taking into account these limitations, the results en- courages researchers on the eld to formulate further hypotheses to be tested in 550 subsequent experiments. 27 A rst scenario to be analyzed involves the assessment of the proposal un- der di erent noisy conditions. An even more interesting proposal is to assess the classi cation performance of the models on a power network di erent from which they were trained. Such experiments would allow to test the impact of a 555 power network topology and operative condition over the diagnosis model, get- ting insights about one of the main issues regarding the application of machine learning techniques on power quality diagnosis: the portability of the technique and the models obtained through di erent power systems, network topologies and operating conditions. 560 Acknowledgements This work was supported by Agencia Santafesina de Ciencia, Tecnolog a e Innovaci on (ASaCTeI) under IO 2010-058-16, Consejo Nacional de Investiga- ciones Cient  cas y T ecnicas (CONICET), and Microrredes El ectricas Hibridas con Alta Penetraci on de Energ as Renovables (MEIHAPER) thematic network 565 (CYTED 717RT0533).