원시데이터 수집 시스템
선정목록으로

Data Study Group Final Report: University of Strathclyde and Supergen Energy Networks Hub

관련 산업용 섬유 · (9) 타이어코드

기본 정보

저자
  1. Data Study Group team — The Alan Turing Institute
DOI
10.5281/zenodo.5820436
저널
Zenodo (CERN European Organization for Nuclear Research)
발행년도
2022
발행기관
European Organization for Nuclear Research
피인용수
0
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://zenodo.org/record/5820436
토픽
Hybrid Renewable Energy Systems
OpenAlex ID
W4226304043

평가 내용

관련도
관련
사업분야
산업용 섬유 · (9) 타이어코드
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '산업용 섬유 > 타이어코드' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

<p>Data Study Groups are week-long events at The Alan Turing Institute bringing together some of the country’s top talent from data science, artificial intelligence, and wider fields, to analyse real-world data science challenges.</p> <p><strong>Using machine learning to predict the onset of blackouts</strong></p> <p>Power grids are a fundamental part of today’s infrastructure - almost all aspects of modern life require power. Blackouts can be catastrophic events that can lead to great discomfort or even fatalities. Due to the high degree of spatial correlation of power grid networks, sudden changes in the operating conditions of a given component can cause failures in other nearby components. These failures may then affect other components causing further failures, resulting in a series of failures, known as a cascade, which can result in a blackout. Recently blackouts have become more frequent due to two primary factors: the increased complexity of grids caused by incorporating generators with a more variable power output, such as wind and solar, and the increased frequency of extreme weather events causing damage to grid components. Hence, reliability is a growing concern in power grids. Although there are many countermeasures and safety nets to avoid power outages, the vast amount of system parameters makes it difficult to predict and account for all failure modes. Furthermore, modelling of the physics of power grids requires numerically solving systems of hundreds or thousands of coupled differential equations, making an online physics-based approach to blackout prediction impossible with today’s computing power. Machine learning approaches, in particular deep neural networks, are very promising because they are universal function approximators and can therefore learn the complex relationships between the large number of system parameters and the resulting failure events.</p> <p>The overall aim of this challenge is to investigate the spatial and temporal distribution of failures across the power grid, examine the relationships between the components and predict the first failure before it happens in order to prevent it. We use the simulated dataset provided by the University of Strathclyde & Supergen Energy Networks Hub and utilise machine learning methods to achieve exciting results. We also aim to identify the limitations of the data and the methods used in order to provide a road map for future research.</p>

본문 58,866자

본문 펼치기
# Data Study Group Final Report: University of Strathclyde and Supergen Energy Networks Hub ### 14 – 24 Sep 2020 #### Using machine learning to predict the onset of blackouts ________________________________________________________________ https://doi.org/10.5281/zenodo.5820436 ##### Contents 1 Executive summary 2 1.1 Challenge overview . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Data overview . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3 Main objectives . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.4 Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.5 Main conclusions . . . . . . . . . . . . . . . . . . . . . . . . 4 1.6 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.7 Recommendations and future work . . . . . . . . . . . . . . 5 2 Data overview 6 2.1 Dataset description . . . . . . . . . . . . . . . . . . . . . . . 6 2.2 Data quality issues . . . . . . . . . . . . . . . . . . . . . . . 8 2.3 Exploratory data analysis . . . . . . . . . . . . . . . . . . . 8 3 Methodology 12 3.1 Pre-processing steps . . . . . . . . . . . . . . . . . . . . . . 13 3.2 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.3 Feature Importance . . . . . . . . . . . . . . . . . . . . . . 22 4 Experiments 23 4.1 Logistic Regression . . . . . . . . . . . . . . . . . . . . . . 23 4.2 LSTM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.3 Auto-encoders . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.4 LSTM with Auto-encoder Processed Input . . . . . . . . . . 27 5 Results 28 5.1 Model performance . . . . . . . . . . . . . . . . . . . . . . . 28 5.2 Feature importance . . . . . . . . . . . . . . . . . . . . . . 29 6 Conclusions 33 7 Future work and research avenues 34 8 Contributors 36 8.1 Team members . . . . . . . . . . . . . . . . . . . . . . . . . 36 8.2 Challenge Owners . . . . . . . . . . . . . . . . . . . . . . . 37 8.3 Challenge PI . . . . . . . . . . . . . . . . . . . . . . . . . . 38 1 ##### 1 Executive summary ###### 1.1 Challenge overview Power grids are a fundamental part of today’s infrastructure - almost all aspects of modern life require power. Blackouts can be catastrophic events that can lead to great discomfort or even fatalities. Due to the high degree of spatial correlation of power grid networks, sudden changes in the operating conditions of a given component can cause failures in other nearby components. These failures may then affect other components causing further failures, resulting in a series of failures, known as a cascade, which can result in a blackout. Recently blackouts have become more frequent due to two primary factors: the increased complexity of grids caused by incorporating generators with a more variable power output, such as wind and solar, and the increased frequency of extreme weather events causing damage to grid components. Hence, reliability is a growing concern in power grids. Although there are many countermeasures and safety nets to avoid power outages, the vast amount of system parameters makes it difficult to predict and account for all failure modes. Furthermore, modelling of the physics of power grids requires numerically solving systems of hundreds or thousands of coupled differential equations, making an online physics-based approach to blackout prediction impossible with today’s computing power. Machine learning approaches, in particular deep neural networks, are very promising because they are universal function approximators and can therefore learn the complex relationships between the large number of system parameters and the resulting failure events. The overall aim of this challenge is to investigate the spatial and temporal distribution of failures across the power grid, examine the relationships between the components and predict the first failure before it happens in order to prevent it. We use the simulated dataset provided by the University of Strathclyde & Supergen Energy Networks Hub and utilise machine learning methods to achieve exciting results. We also aim to identify the limitations of the data and the methods used in order to provide a road map for future research. 2 ###### 1.2 Data overview This project uses the dataset provided by University of Strathclyde & Supergen Energy Networks Hub. This dataset consists of 44,064 simulations where the simulated power grid is a slightly modified version of the IEEE 39 bus system [1]. Each simulation is performed under a unique set of discretised operating conditions and saved in a separate CSV file, with 248 features describing the states of the power grid components through time. During each simulation, a disturbance is introduced to the system at 1.0 seconds. Following this, the faulted line along which the disturbance occurred is disconnected at at 1.07 seconds, reflecting the events that occur in the event of a real-life sudden failure. This disturbance aims at casting the system into an out of balance regime that may lead to cascading failures. ###### 1.3 Main objectives System failures across a power grid varies both spatially and temporally. The failure of a critical component can often lead to the failure of multiple components. This type of a cascading failure event is both costly and inconvenient as the power system is one of the most important parts of infrastructure in today’s society. Hence, our main objectives are as follows: _•_ Predict failure events (and possibly cascading failures) before the first failure occurs _•_ Understand the spatial and temporal distribution of failures across the power grid _•_ Examine the relationships between power components with respect to system dynamics and failures ###### 1.4 Approach In our work, we start by performing exploratory analysis of the data such as a distribution, collinearity and failure mode and time statistics. The purpose of this exploratory analysis is to understand the contextual 3 meaning of the variables studied and investigate any potential correlations, which might affect our further data analysis. This analysis showed that successive failures for load connections are tightly coupled in terms of failure time after the first failure, indicating one of the challenges of this analysis. We pre-process the simulation data based on our findings and focus on enabling online predictions. Furthermore, we frame the power grid failure prediction problem as binary classification and anomaly detection tasks, and we try to predict the first failure before it occurs. Since this is a multivariate time series problem of sequential events, we use methods that are popular in the literature for this type of analysis. Therefore, we train and evaluate four different approaches: logistic regression, Long Short Term Memory (LSTM), auto-encoder models and an LSTM model with auto-encoder processed input. We use logistic regression and LSTM models for supervised binary classification and auto-encoders for unsupervised anomaly detection. Finally, we apply feature importance techniques to determine which variables in the system have the most significant effect in cascading events. ###### 1.5 Main conclusions We reached the following major conclusions in this work: _•_ Cascade failure prediction as a task is not only addressable by machine learning techniques, we can achieve high accuracy with predictive models. _•_ We compared several modelling approaches, including Logistic Regression (LR), Long Short-Term Memory (LSTM) networks, and encoder-decoder structures. _•_ Performance metrics with our test set were highly encouraging, with the LR and LSTM models achieving an F1-score of 0.93. _•_ We conducted an analysis of the relative importance of available features to classification performance, concluding that generator lines provide the most predictive power, while transformer load and bus voltage provide little useful information. 4 ###### 1.6 Limitations The limitations we encountered regarding the dataset and the methodology are as follows: _•_ The dataset is highly imbalanced with 7,131 simulations that resulted in at least one failure and 35,934 that resulted in no failures. There were also 999 simulations that did not converge and thus were not usable. Moreover, out of the simulations that resulted in at least one failure, the total number of component failures varied. _•_ Exploratory analysis performed demonstrates that in the event of a cascading failure, the components fail almost instantaneously after the first failure. Hence, it is much more important to predict the first failure rather than predicting the exact sequence of the cascade. _•_ Due to the large size of the dataset, the methods used in this project are limited to ones that allow batch processing and incremental training, such as neural networks. This limited the explainability of the final solution presented. _•_ Exploratory analysis shows that the majority of the first failure events happen with 1.5 seconds of the system disruption. Hence, the window size used in are experiments is set to be small enough to capture sudden changes in the data. ###### 1.7 Recommendations and future work Considering the duration of the data study group, many challenges could not be investigated, but some suggestions are proposed to tackle these challenges in more depth. Promising approaches for future work are identified below. _•_ Change the time-frame analysed and investigate the corresponding impact on the performances of the models. _•_ Perform dimensionality reduction based on feature importance, correlation and clustering may help to reduce the computational requirements for model training. _•_ Predict the time steps associated with a cascade given a specified 5 target forecasting window size, in order to forecast cascading sequence. _•_ Implement multi-class classification algorithms. For instance graph based models may be a fruitful avenue to explore due to the spatiotemporal nature of the problem as we know the network topology. ##### 2 Data overview ###### 2.1 Dataset description A dataset consisting of 44,064 simulations has been provided by University of Strathclyde & Supergen Energy Networks Hub for the experiments where the simulated power grid is a slightly modified version of the IEEE 39 bus system, a commonly used benchmark topology for power systems. The simulation was conducted using PowerFactory software. The schema of the simulated bus network is given in Figure 1. Load flow analysis is a method of steady-state analysis commonly used in power system calculations. A bus is a node where a line or several lines are connected and may also include loads or generators in a power system. The system under analysis consists of loads, capacitor banks, transmission lines, and generators. Each simulation is performed under a unique set of discretized operating conditions: fault location (line on which the fault happens), system loading (range 0.7-1.2 in 0.1 steps), active power output of the 3 wind generators (range 0-1 in 0.2 steps). Moreover, a disturbance is introduced to the system at 1.0 seconds and removed at 1.07 seconds. The time series data of each simulation is saved in a separate CSV file, with 248 features describing the states of the power grid components through time. These features consist of time domain responses for: voltage and frequency of bus elements, current, active and reactive power of lines, transformer tap positions, speed, rotor angle, excitation current, active and reactive power of generators and active power of wind generators. A results file is also provided and includes a summary of all the simulations and the events that appeared, with the columns representing the variables in the following format: simulation ID number, fault location, 6 Figure 1: An overview of the simulated bus network in which 39 nodes, known as buses, are connected by lines in the topology shown. There are also 10 generator nodes, 3 of which are composed of wind farms. 7 system loading, active power outputs of the 3 wind generators, flag, cascading events sequence (if any). Flag is a variable set to describe the output of the simulation where flags 0, 1, 2 and 3 denote no failures, at least one failure, the algorithm did not converge and other simulation errors respectively. Simulations with flag values 2 and 3 are not used in the experiments. The frequency of occurrence of each simulation flag is presented in Table 1. Flag Event Number of instances 0 No component failures 35934 1 One or more component failures 7131 3 Errors in simulation 999 Table 1: Summary of failure events for all simulations ###### 2.2 Data quality issues Some of the simulations were unusable due to non-convergence issues and simulation errors as outlined in Section 2.1. These simulations were excluded from the experiments as they did not contain any meaningful information. Some of the simulation datasets had missing columns due to wind generators with no power output. We standardised the datasets and filled in the missing columns. The details of the preprocessing steps are given in Section 3.1. ###### 2.3 Exploratory data analysis For each simulation, a disturbance is introduced to the system at 1.0 seconds and removed at 1.07 seconds. The location (line on which the fault happens) and the system loading of the disturbance is discussed in Section 2.1. As discussed above, the number of component failures varies for a simulation in which at least one failure occurs. A histogram of the number of failed components (across all failure cases) is shown in 8 Figure 2. The mean and standard deviation were found to be 9.701 and 13.708, respectively. Figure 2: Number of failed components in simulations resulting in more than 1 failure Our analysis shows that the vast majority of the first failures in a single or multi-component failure event generally occur within the first 2.5 seconds of the simulation as shown in Figure 3 and Figure 4. In the case of cascading failures, the time between all sequential component failures and time between the first and second component failures were also investigated. The results of these analysis show the time between the first and second failures is on average 7.813 seconds with a standard deviation of 16.422, as shown in Figure 5. On average, the time between sequential failures is 2.12s on average with a standard deviation of 10.451s. However, in many cases, successive failures occurred almost immediately (¡ 0.1 s) after the failure of the first component. These almost immediate cascades were generally found to be associated with load connections, whereas delayed cascading failures (with a longer time between successive component failures) were more commonly associated with other components, such as generators. 9 Figure 3: Time of the first component failure Figure 4: Time of the first component failure-zoomed in. 10 Figure 5: Time between first and second component failures 11 ##### 3 Methodology Based on the exploratory analysis of the dataset, we performed a series of data pre-processing and experimented with multiple machine learning approaches. Our analysis showed that in the event of a cascading failure, components fails almost instantaneously after the first failure. Hence, we focus on the online prediction of the first failure and frame our modelling approaches as a binary classification task or anomaly detection task (e.g. fail / no fail, anomaly / normal). Our methodology flowchart is shown in Figure 6 and elaborated in the following subsections. Figure 6: Methodology Flowchart 12 ###### 3.1 Pre-processing steps In order to make the dataset suitable as input into our selected machine learning models, a number of pre-processing steps were performed. They include missing data handling, angle transformation, interpolation and normalisation. Each step was implemented as a single function or group of functions, creating easily understandable and readable code. 3.1.1 Missing data As outlined in Section 2.2, some of the simulation datasets had missing columns due to the lack of power output of wind farm generators. In order to address this, new columns were added to the datasets with missing wind generator columns and were padded with zeros. 3.1.2 Angle Transformation Furthermore, the datasets consist of 248 variables describing the temporal states of the power grid components. Some of the features in the dataset describe the rotor angle of a given generator in the system, _θr_, and thus have a periodicity of 2 _π_ . In order to preserve this periodicity, such that angles of 1.99 _π_ and 0.01 _π_ are close to one another in value for instance, this data was transformed into its sine and cosine components via the mapping: _θr_ _�→_ sin( _θr_ ) _,_ cos( _θr_ ) _._ (1) Thus, a new column was created and the non-transformed angular column was removed for each generator rotor angle feature. 3.1.3 Interpolation The time steps are not the same for each raw data file. In order to address this challenge, an interpolation function was implemented, to create equal time steps. The choice of the kind of interpolation was done after visual checks on various plots of the data. The ’slinear’ interpolation was chosen, it refers to a spline interpolation of first order. 13 Finally, the time difference between consecutive data i.e. the time interval was chosen to be of 0.01 seconds. 3.1.4 Normalisation It was observed that the dataset contained measurements with units that were widely disparate - per units, Mega Watts, Mega Vars & Kilo Amps. The data of measurements in per unit (p.u.) are scaled with physically meaningful quantities in the simulator that ensure that the resulting magnitudes are in the range of 1-10 for nominal operation and after a disturbance. The other quantities are in the range of magnitudes between 100 to 1000. The following plots demonstrate this discrepancy. Figure 7 plots the voltage in per unit at two locations in the system. The nominal value of the voltages are close to 1 before the fault, and the maximum value of the voltage after the disturbance is less than 1.5 for all simulations, and at all the locations. In contrast, figure 8 plots the power measurements in the grid and it can be seen they are all very large in magnitude (-800 to +1000). This is the case for all the simulations. Figure 7: Sample voltages in p.u. versus time. 14 Figure 8: Sample measurements in MW versus time Using these values directly for ML models is likely to lead to extremely slow training with low accuracy. This is due to the numerical instabilities in the gradient descent techniques used for training ML models. Two approaches were explored for normalising the data. The normalisation was done independently for each measurement (”column”) in the dataset. 1. Subtracting the mean value of the dataset from each measurement and dividing the result by standard deviation. 2. Dividing each measurement by a scaling factor. The output of the first approach essentially results in each column having zero mean with unit standard deviation. Resulting data set is ideally the most appropriate data set for training as machine learning literature assumes input data to be zero mean and unit variance. However, applying this method to the data was challenging due to the following properties of the data. 15 1. There were measurements (such as the frequency, etc) that had very minimal variation in the data. This made the estimated standard deviation very low, making it susceptible for numerical issues. The columns that had low variance is dependent on the fault scenario. 2. The large number of samples made it impractical for the true mean and true standard deviation to be estimated. Instead, a random sample of simulations are chosen and the mean and standard deviation of each measurement is estimated for each simulation. The average of the mean and standard deviation for all the selected simulations are used as the final mean and standard deviation. 3. The error in the standard deviation compared to the true values for the measurements with small standard variances caused the normalised values to be very large in magnitude as the small variance was in the denominator. In view of the above challenges, the second approach of scaling the column values is taken to scale the columns (divide the measurements) by a value that ensured that all the final inputs to the ML models were in the same order of magnitude. For this purpose, after a set of heuristics were applied to the data, the following scaling values were chosen 1. The scaling value for all quantities in per unit (p.u.) is 1 2. The scaling value for all quantities in MW, MVAr & kA is 100 This scaling led to all the measurements to be in between -10 and +10. The plots in figure 9 show the variation of the scaled measurement versus time for a disturbance. The values are in the same order of magnitude of the per unit values now and will not cause numerical challenges for the learning algorithms. 16 Figure 9: Scaled measurements versus time This process was applied to each single simulation dataset in turn and the processed output datasets were pickled in a new directory in order to maintain a clean workflow. 3.1.5 Filtering In all of the simulations, a disturbance was introduced to the system at 1.0 seconds and removed at 1.07 seconds. For cascading failures, we filtered the simulation data to only include data starting from the removal of the disturbance (1.07 seconds) up to 0.5 seconds before the first recorded failure. In doing so, we ensured that there would be enough time to take counter measures in order to prevent to first failure. 3.1.6 Windowing As discussed in the previous section, simulations with failures were filtered to exclude data before the disturbance and after 0.5 seconds 17 before the first failure and thus were of variable lengths (number of fixed time steps included). In order to generate evenly sized data samples that can be used as model inputs, we used a windowing function that splits the time series samples to partly overlapping, evenly sized subsets while preserving the time dependencies within the generated windows. The amount of the overlap between sequential windows is determined by the shift value, which is often set to be in range of 1/4th - 1/3rd of the window length. A diagram of the windowing process can be seen in Figure 10. As outlined in Section 2.3, the first failure event takes place at 0.5s-2.5s after the fault clearance in 98.8% of all cases and cascading failures take place almost instantaneously after the first failure in most cases. Hence, the window size has to be in the range of 0-0.5s in order to capture shortterm data dependencies and allow performing real-time model inference to detect any approaching failure. Based on our findings, we set the window length to 100 time steps (0.1s) and the shift value to 25. Figure 10: Window generation ###### 3.2 Methods Given the extreme non-linearity and complexity of modern power grids, it is impossible to analytically calculate dynamic behaviour in real time, hence, machine learning is highly appropriate in this use case. In our work, we frame the power grid failure prediction problem as binary classification and anomaly detection tasks, and try to predict the first 18 failure before it occurs. While there are many suitable machine learning approaches (e.g. XGBoost, Isolation Forest) for these tasks, the methods used in our work are limited to ones that allow batch processing and incremental training due to the large size of the dataset. Methods that allow batch / incremental training enable using only a part of the data to update the model parameters as opposed to reading the whole dataset into the memory at once. Since it is not possible to load our large dataset into memory at once, we can not use many of the machine learning approaches and autoregressive models. Hence, the machine learning methods examined in this study are logistic regression, LSTM and auto-encoder models. We use logistic regression and LSTM models for binary classification and auto-encoders for unsupervised anomaly detection. The details of these approaches are elaborated in the following subsections. 3.2.1 Logistic Regression The logistic regression model is a statistical model that in its basic form uses a logistic function to model a binary dependent variable. This method essentially identifies a high dimensional hyper-plane that separates the data into two classes. This is mathematically represented as _y_ = _σ_ ( w <sup>t</sup> _·_ x + _w_ 0) where _σ_ ( _·_ ) is the sigmoid function, w = [ _w_ 1 _, w_ 2 _, ..., wm_ ] are the classifier weights and _w_ 0 is the classifier bias. Figure 11 is the overall schematic of a logistic regression based classifier. The weights are trained using the training dataset and a loss function (usually the binary cross-entropy function). 19 Figure 11: Schematic diagram of logistic regression [2] 3.2.2 Auto-encoder Auto-encoders are neural networks capable of learning representations of large datasets that reduce the dimensionality of the input space [6, 7, 3, 4]. An auto-encoder consists of two parts, the encoder and the decoder, which can be defined as transitions _φ_ and _ψ_ such that: _φ_ : _X_ _→F_ _ψ_ : _F_ _→X_ (2) _φ, ψ_ = arg min _∥X_ _−_ ( _ψ ◦_ _φ_ ) _X∥_ <sup>2</sup> _φ,ψ_ The encoder part consists of a series of layers that gradually maps the input to a lower dimensional representation space. The decoder part takes the output from the encoder bottleneck and gradually maps it to a representation space with the original input’s dimensions, essentially reconstructing the encoder’s input. In the simplest case, both encoder and decoder are fully connected (dense) neural networks, but can also be constructed by recurrent layers (e.g. LSTM) or convolution layers. In general, the output dimensions of the bottleneck is a very important parameter of the auto-encoder as highly compressed data is more difficult for the decoder to reconstruct. A general schema of the auto-encoder architecture can be seen in Figure 12. Auto-encoders have many use cases such as synthetic data generation, dimensionality reduction, and anomaly detection. In this study we consider both LSTM-based and convolutional auto-encoders for 20 Figure 12: Schematic diagram of an auto-encoder [13] unsupervised anomaly detection, that is, we generate neural representations of ’ordinary’ operational inputs in order to spot an anomalous input that indicates an imminent failure. 3.2.3 LSTM The LSTM network is a kind of recurrent neural network that is capable of learning long-term dependencies [8, 5]. Unlike vanilla recurrent neural networks which suffer from the vanishing gradient problem, LSTM uses memory cells to maintain information for long periods. A common LSTM unit is composed of a cell, an input gate, an output gate and a forget gate. The cell remembers values over arbitrary time intervals and the three gates regulate the flow of information into and out of the cell. Their applications include classification of sequential or time series data. The gates in LSTMs regulate the flow of information, as shown in Figure 13. 21 Figure 13: A schematic representation of LSTM [12] ###### 3.3 Feature Importance The theory behind feature importance is to investigate the effect of each feature on model performance, with the goal of reducing the number of features in mind. This can be achieved through randomly shuffling values for an isolated feature (removing the information from the column) and measuring the difference in performance of the model before and after, using the chosen metrics. Each permutation score represents the change in the performance of the model. This method does not require re-training the model and is hence optimal for a problem such as this with a large dataset in which training is expensive. Alternative methods include dropping each column in turn and re-training the model which can avoid feature correlation issues, but due to the large number of columns this would be very time-consuming for this problem. The scores that the module returns represent the change in the performance of a trained model after feature permutation and the more important features can be identified as those producing a larger change in the performance. To get more insights on feature importance and how to explain black box models, see [9] and [11]. 22 ##### 4 Experiments For all of the experiments, we use the preprocessed datasets as outlined in Section 3.1. Furthermore, we filter the datasets with one or more/cascading failures to only include data starting from the removal of the system disturbance (at 1.07 seconds) up until 0.5 seconds before the first observed failure. By doing this, we aim to predict the first failure or detect anomalies before the first failure occurs and enable taking counter measures to prevent the the first failure and/or the cascading failures. We conduct five experiments: a logistic regression model and an LSTM model for binary classification, sequential and convolutional auto-encoders for anomaly detection, and an LSTM model which uses auto-encoder processed data as input for binary classification. For all of the experiments, we generate evenly sized time series by windowing and use a window size of 100 (time steps) and a shift value of 25 as discussed in Section 3.1.6. In all of the experiments, we follow the best practices and use the optimal parameters reported in the framework such as the number of hidden units, learning rate, step size, etc. Based on our window length, we set the batch size to 256 in all experiments to ensure the inclusion of the minority class data (’fail’) in all batches. Moreover, we observed that all models converge easily and hence, we set the training epoch number to 10, as it was found that it leads to convergence and use early stopping in order to avoid overfitting in all of the experiments. The detailed experimental setups of the experiments are described in the following subsections. ###### 4.1 Logistic Regression To train the logistic regression, we use 3,500 simulations without any failures and 3,500 simulations with single or multi-component failures to generate a full dataset. We separate this set into training, validation and test splits with 6,000, 500 and 500 items respectively, with each set including an even number of simulations with failures and no failures. During the data subsetting and model training processes, we set the 23 environment and model seed to 17 to ensure reproducibility. Furthermore, we use the default learning rate value of 0.001 and train the models for 10 epochs on a single GPU with a batch size of 256 and early stopping enabled (based on validation loss). Once the model is trained, we perform inference on the test set and compare the predicted against the true labels of the test set. The accuracy, recall, precision and F1 score on the test set are given in Section 5. ###### 4.2 LSTM To train the LSTM mpdel, we use 3,500 simulations without any failures and 3,500 simulations with single or multi-component failures to generate a full dataset. We separate this set into training, validation and test splits with 6,000, 500 and 500 items respectively, with each set including an even number of simulations with failures and no failures. We use a single layer LSTM, where the number of hidden units _ht_ is 50. Moreover, we use the Adam optimizer and binary cross entropy as our loss function. During the data sub-setting and model training processes, we set the environment and model seed to 17 to ensure the experiment is reproducible. Furthermore, we use the default learning rate value of 0.001 and train the models for 10 epochs on a single GPU with a batch size of 256 and early stopping enabled (based on validation loss). Once the model is trained, we perform inference on the test set and compare the predicted against the true labels of the test set. The accuracy, recall, precision and F1 score on the test set are given in Section 5. ###### 4.3 Auto-encoders 4.3.1 LSTM Auto-encoder An LSTM auto-encoder is an implementation of an auto-encoder for sequence data using an encoder-decoder LSTM architecture. For the LSTM based auto-encoder model, we first create training and test sets by subsetting the dataset. For our training set and validation set, we use 6000 and 500 simulations without any failures respectively. For our test set we use 500 simulations without any failures and 500 simulations with one or more failures. The auto-encoder architecture consists of 6 LSTM 24 layers (3 for the encoder and 3 for the decoder) for the sequential auto-encoder, where the number of units in the hidden layers are 50, 10 and 4 respectively. During the data sub-setting and model training processes, we set the environment and model seed to 17. We use the Adam optimiser and mean absolute error as our loss metric. For both experiments, we keep the default learning rate of 0.001 and train the models for 10 epochs on a single GPU with a batch size of 256 and early stopping enabled (based on validation loss). Figure 14: Mean Absolute Error for reconstruction of training set using the auto-encoder Once the models are trained, we reconstruct the training set using the trained auto-encoder and plot the mean absolute error of reconstruction. We observe that the reconstruction loss of the training set has a Gaussian distribution, hence we set the 95 <sup>th</sup> percentile of the train set losses as our loss threshold. Furthermore, we encode the test set using the trained autoencoder, record the mean absolute errors of reconstruction and use the threshold value to assign labels to the test set. We label instances above the selected threshold as ’anomalies’ and the rest as ’normal’ data. Finally, 25 we compare the predictions against the true labels of the test set instances to compute the accuracy, recall, precision and the F1 scores. The Mean Absolute Error (MAE) for the auto-encoder reconstruction of the training set is shown in Figure 14. 4.3.2 Convolutional Auto-encoder The convolutional 2D auto-encoder is another type of auto-encoder that uses 2D convolutional layers. The input to the model is a 3 dimensional matrix with the 3 dimensions being: samples, timesteps, features. The shape of this dataset ends up being 25516 x 100 x 259. A dummy variable was added to the original 259 features to put it in the shape that works for the model architecture. The hyper-parameters (kernel size, stride, padding) for each convolution layer implemented is shown in Table 2. The Conv2D(3,3) denotes 2D convolutional layer with filter size 3x3. MaxPooling2D(3,3) denotes downsampling by 3 in the time-step direction and by 3 in the feature direction. UpSampling2D(3,3) denotes upsampling by 3 in the time-step direction and by 3 in the feature direction. The trained model was then used for anomaly detection to predict the failure or non-failure cases. For the anomaly detection, we first compute the Mean Squared Loss on the training data after model training. Then we apply a statistical thresholding method to compute the anomaly threshold. <u>Layer</u> <u>Type</u> <u>No.</u> <u>filters</u> <u>Padding</u> 1 Conv2D(3,3) 16 valid 2 MaxPooling2D(2,2) - same 3 Conv2D(3,3) 1 same 4 MaxPooling2D(2,2) - same 5 Conv2D(3,3) 1 same 6 Upsampling2D(2,2) - same 7 Conv2D(3,3) 16 same 8 Upsampling2D(2,2) - same 9 Conv2D(3,2) 1 same Table 2: 2D Convolutional auto-encoder 26 ###### 4.4 LSTM with Auto-encoder Processed Input The auto-encoder training process is the same as the auto-encoder experiments described in Section 4.3.1. In this approach, we use the trained auto-encoder to encode the LSTM training data and feed the encoded data into the LSTM model. In order to train the LSTM model, we create a training, validation and test sets independent of the data used in the auto-encoder experiment. As same as the LSTM, we create training, validation and test sets with 6000, 500 and 500 simulations respectively with each set including an even number of simulations with failures and no failures. We use the encoded training data to train a single layer LSTM model with the same hyperparameters as the LSTM model described in Section 4.2. Same as the other experiments, we set the environment and model seed to 17 during the data subsetting and model training processes. Furthermore, we use the default learning rate value of 0.001 and train the models for 10 epochs on a single GPU with a batch size of 256 and early stopping enabled (based on validation loss). Once the model is trained, we perform inference on the test set and compare the predicted against the true labels of the test set. The accuracy, recall, precision and F1 score on the test set are given in Section 5. 27 ##### 5 Results ###### 5.1 Model performance The results of the models applied are summarised in Table 3. As the dataset is imbalanced, the accuracy is not necessarily a good measure of the performance, but it is included for completeness. <u>Model</u> <u>Accuracy</u> <u>Precision</u> <u>Recall</u> <u>F1 Score</u> Logistic Regression 0.93 0.98 0.87 0.93 LSTM 0.92 0.88 0.98 0.93 LSTM Auto-encoder 0.73 0.87 0.53 0.66 LSTM w/Auto-encoder 0.5 0.5 1.0 0.67 Processed Input Table 3: Trained models and results. The baseline logistic regression model performed very well given its simplicity, achieving the highest precision and accuracy and the joint-highest F1 score. The LSTM model falls below the baseline in all metrics except recall, indicating that it has a higher sensitivity, due to the fact that it has a much larger number of parameters (as we would expect). The LSTM auto-encoder (anomaly detection model) is able to determine anomalies with a precision of 0.87, however the recall is low, indicating a low sensitivity and a large number of missed true positives. Finally, the losses of the LSTM with auto-encoder processed input model did not change during the training and we see that it has a recall of 1, meaning that there are 0 false negatives. Thus, the model always predicts a failure and has not learned anything useful. The convolutional auto-encoder models (Conv1D and Conv2D) for anomaly detection exhibited the worst performance seen in our trialsThe losses did not improve during the training and so the results have not been included in Table 3. Using different threshold methods, the F1, recall and precision score for failure case (label=1) mostly gave a value of 0. We can say from this that the convolutional auto-encoder model almost always predicts no failure. For the task of classifying whether or not a cascading failure will occur, a 28 false negative is much worse than a false positive: a real cascade being missed causing a blackout is worse than a single line or component being unnecessarily disconnected by an intervention. Thus, a higher recall is of greater importance than a higher precision, assuming that the model also has a reasonable F1 score. Thus, the simple LSTM model is more suitable for this problem than the logistic regression model, as it will result in fewer false negatives, i.e. missed failures, at the price of mislabelling more non-cascade events as failures. Lastly, it is important to discuss the relative complexity, and hence computational requirements, for the different models. One metric for this is the number of parameters in the model, which was 260 for logistic regression and 62,051 for the simple LSTM. Thus, the logistic regression model offers a good trade-off between computational requirements and performance, as it is significantly easier to train and offers comparable performance. Moreover, the logistic regression model is far more explainable owing to its simple architecture - one can simply look at the values of the weights of the trained model to infer how much was learned from each feature. Such simple analysis is not possible for the LSTM. However, the extra complexity of the LSTM means that it is able to correctly identify more true failures. Also, it should be noted that the training time does not scale linearly with the number of parameters for these models. In fact, the logistic regression and LSTM models trained in roughly 15 and 30 minutes respectively on the provided GPU. For completeness, the LSTM auto-encoder and the LSTM with auto-encoder processed input models have 572 and 90,833 parameters respectively. ###### 5.2 Feature importance Once the highest-performing models, the Logistic Regression and LSTM, had been developed and trained, permutation feature importance analysis was performed to identify which features the respective models were able to learn the most useful information from. This was done by evaluating the trained LSTM model with individual columns permuted and recording the corresponding change in the accuracy of the classifier. The 18 most significant features are shown in Figure 15, indicating that the 29 Figure 15: Permutation feature importance analysis for the LSTM model. Here, individual feature columns have been permuted and the resulting loss or gain in classifier accuracy as compared to the non-permuted baseline is recorded. most influential lines and generators are all lines and generators. It is interesting to note that the accuracy improved when some of the generator columns were permuted, whereas for other generators the accuracy was seen to decrease. This can be explained by considering that each generator is actually composed of multiple features, such as the rotor angle and speed. The corresponding generator features in Figure 15 are the reactive power for the G08, G10, G02 generators, active power for generator G01 and the sine of the rotor angle for generator G07. We expect this for the active and reactive power because they are heavily correlated: Reactive power = Active power _×_ tan( _φ_ ) _,_ (3) where _φ_ is the phase lag between the current and the applied voltage in the system. Thus, these variables should not both be included when training any model. 30 Figure 16: Permutation feature importance analysis for the logistic regression model. Here, the columns corresponding to groups of power system d and the resulting loss or gain in classifier accuracy as compared to the non-permuted baseline is recorded. The same analysis was also performed by component type, this time using the logistic regression model, and is presented in Figure 16. This shows that lines and generators are, in general, the most important features to consider, whereas the transformer loads and the voltages at the low voltage side of distribution transformers (B ~~L~~ ), were the least beneficial for the model and actually seem to decrease its performance. We expect this as the transformer loads and B ~~L~~ loads are voltages and are simply related by the transformer equation: Transformer load = <sup>_<u>NT</u>_</sup> _NB_ _×_ B ~~L~~ load _,_ (4) where _NT_ and _NB_ are the number of turns at the high voltage transformer side and the low voltage bus side respectively. Thus, these variables are strongly correlated and should not both be included when training any model. These results could be used to reduce the number of features 31 used in the training of future models, perhaps meaning that more complex models, such as graph neural networks, become more feasible to train. 32 ##### 6 Conclusions Our primary conclusion is that impending failure in the system is effectively predictable using machine learning methods. Our analysis concludes that a carefully calibrated system of classification modelling combined with a feature selection process can make highly accurate predictions given our test set. These results should be validated with access to larger and more diverse datasets, as well as a wider range of potential model and hyperparameter setups. Overall, the baseline logistic regression approach performed very well, achieving a F1-score of 0.93 (harmonic mean of precision and recall). The LSTM model achieves the same F1-score and a higher recall but is slightly under the baseline model in terms of accuracy and precision metrics. The unsupervised auto-encoder achieves a precision of 0.87 but with a low recall, indicating a low sensitivity and a large number of missed true positives. Finally, the encoder-decoder LSTM model did not manage to learn useful information as its recall is of 1. Regarding the feature importance analysis, we focused on feature permutation to identify important features (defined as features producing a larger change in performance when permuted). Our results indicate that lines in generators are, overall, the most important features; on the contrary, transformer loads and load bus voltage could potentially be removed from the inputs to achieve higher performance. What’s more our analysis suggests that all generators’ features should not be included as they are highly correlated and thus only bring redundant and potentially noisy information, as implied by Figure 15 and 16. 33 ##### 7 Future work and research avenues It is important to consider that this is a large-scale engineering problem and, as such, it should be treated in an engineering context going forward. The end goal of this research would be a model that is able to be trained on simulated data offline that can then be used to identify the onset of all cascades in a real power grid, giving the operators sufficient warning to intervene and stop the cascade, most likely with an automated response. Ideally, this model would be refined with online learning from real network data once installed, to help bridge the gap between the simulations and the real behaviour of the system. Otherwise, this discrepancy will need to be quantified and an appropriate margin installed to counteract it. Either way, a demonstration of how well the model generalises to real network data should be performed. Furthermore, the information that is available in real-time from deployed electrical power networks should be considered. It may be that not all simulated variables are easy to obtain with sufficient accuracy and latency in a practical system. Measurement errors will also occur, which should be quantified and accounted for. Many challenges were identified that could not be investigated in detail in the duration of the data study group. The below topics are expected to add additional value to the analysis presented in this report: _•_ Sensitivity of model performance to time-frame analysed : The current time series datasets for failure scenarios have been filtered to only consider data following the introduction of the artificial system perturbation, up until 0 _._ 5s before failure of the first component. The pre-processing pipelines in their current form, could be changed to take in less data (stop sampling in advance of 0 _._ 5s before failure) to understand how this will influence the performance of the various models. _•_ Dimensionality reduction : The analysis presented in Section 5.2, provides useful information regarding the influence of the various features on model performance. This could be used as a basis for reducing the number of inputs, which (once validated) would allow for quicker training of future, more complex, models. 34 _•_ Cascading sequence forecasting : A natural evolution of the work conducted in this study is to predict the time steps associated with a cascade given a specified target forecasting window size. This reduces the complexity of the multi-class classification problem, by only considering the time step of a cascade of any form, and ignoring the label of such a cascade. However, the lessons learned from such an exercise would naturally scale to the more complex multi-class classification problem. _•_ Multi-class classification : Cascading sequences are likely spatially correlated. Features which allow the model to learn network topology should be identified. This could be achieved by evaluating model performance on new simulated data with modifications made to the network (taking a line out of service, taking a generator offline). The dataset formulated as a multi-class classification problem will be highly imbalanced, with a significant number of minority classes. A number of approaches should be investigated to attempt to mitigate this issue which include: finding optimal window data sizes and window shift values, reducing the amount of stable data the model is trained on, up-sampling of minority classes using synthetic methods such as SMOTE [10] or up-sampling of minority classes using synthetic data generated from auto-encoders (using active dropout layers for data reconstruction will provide stochastic outputs). We have laid the foundations for the prediction task by showing that a machine learning model can learn to classify failures successfully. However, it is important to think about the barriers to adoption by network operators and deployment on real systems. For instance, operators are likely to resist adoption of difficult-to-interpret black-box methods, due to the large human and financial cost associated with false model predictions. For this reason, incorporation of explainability is crucial for future work. Explainability is a broad term and a model can be explainable in a number of ways, from counterfactual explanations to more probabilistic approaches that offer predictions with a given confidence level. For instance, one may want to define the acceptable probability of error for this system and make sure that the classifier model satisfies this 35 threshold. However, often with explainability comes extra computational load. Thus, Bayesian neural networks may be a good avenue to explore if the dataset used in the future remains large, as batch training could still be used, in addition to the suggestions shown above. ##### 8 Contributors ###### 8.1 Team members Maryleen (Ndubuaku) Amaizu is a 3rd year PhD student at the University of Leicester and Associate Lecturer at the University of Derby. Her research focuses on designing machine learning models for edge-enhanched analytics in Internet of Things systems. Maryleen was a co-facilitator for the project and contributed to designing convolutional neural networks for failure detection as well as writing parts of the report. Oliver Paul is a machine learning researcher for Hitachi ABB Power Grids focusing on deep learning applications to mitigate dynamic instability. Oliver has a diverse background in energy and tech, having previously been a project specialist in energy for the World Economic Forum, involved in early stage startups, and an offshore drilling engineer for Schlumberger. Oliver was a co-facilitator for this challenge. Domenic Di Francesco is a 3rd year PhD student at Surrey University. He has researched industrial applications of Bayesian decision analysis, with a particular focus on hierarchical modelling and preposterior analysis. Domenic was a participant in the project and worked on the exploratory data analysis, preprocessing for the auto-encoder models, feature importance analysis, as well as contributing to the report. Josh Nevin is a 1st year PhD student at the University of Cambridge. His research focuses on using Bayesian machine learning approaches and probabilistic design to optimise resource allocation in optical fibre networks. Josh was a participant in the project and worked on the data preprocessing for all models and feature importance analysis, as well as contributing to the report and the group presentations. Alara Dirik is a 1st year PhD student at Bo˘gazic¸i University. Her research focuses on cognitive learning, developmental robotics and 36 human-machine interaction. Alara was a participant in the project and worked on the data streaming pipeline, building, training and evaluating the LSTM and auto-encoder models, as well as contributing to the report. Chlo´e Sekkat is a 2nd year master student at Ecole <sup>´</sup> Nationale de la Statistique et de l’Administration Economique <sup>´</sup> (ENSAE), in Paris; an engineering school (Grande Ecole) <sup>´</sup> specialized in statistics, economics and data science. She intents to specialise in machine learning to do applied research after her master degree. Chlo´e was a participant in the project and worked on the data preprocessing pipeline, building and training the 2D-conv auto-encoder and LSTM models and feature importance analysis. She also took part in organising the GitHub repository, as well as contributing to the report. Amarsagar Reddy Ramapuram Matavalam is a Post-Doctoral Research Associate in the Electrical and Computer Engineering at Iowa State University, Ames, USA. His research interests are in power system dynamics, power system stability monitoring and control, development of data-drive techniques for power grid stability enhancement. Amar was a participant in the project and worked on the exploratory data analysis, correlation estimation, data-preprocessing for scaling the data, converting the raw data into pickle files, training the logistic regression models, as well as contributing to the report. All authors contributed equally in this project. ###### 8.2 Challenge Owners Panagiotis Papadopoulos s a Senior Lecturer at the Department of Electronic and Electrical Engineering of the University of Strathclyde, working in the area of electric power system stability and dynamics with special interest on applications of machine learning to represent the complex and uncertain dynamic behaviour of power systems. He has received the Dipl. Eng. and Ph.D. degrees from the Department of Electrical and Computer Engineering at the Aristotle University of Thessaloniki, Greece, followed by a post-doctoral position at the University of Manchester. In 2019 he has been awarded a UK Research and Innovation Future Leaders Fellowship on “Addressing the complexity 37 of future power system dynamic behaviour”. Dimitrios Tzelepis received the BEng. (Hons) degree in electrical engineering from the Technological Education Institution of Athens, Athens, Greece, in 2013, and the MSc. degree in wind energy systems and the PhD. degree from the University of Strathclyde, Glasgow, U.K., in 2014 and 2017, respectively. He is currently a Postdoctoral Researcher with the Department of Electronic and Electrical Engineering, University of Strathclyde. His research interests lie within the area of power system protection, automation and control of future electricity grids, incorporating increased penetration of renewable energy sources and high voltage direct current interconnections. His main research methods include implementation of intelligent algorithms for protection, fault location and control applications including the utilisation of machine learning methods and advanced and intelligent signal processing techniques. He is also interested in the application, control and protection of hybrid AC/DC grids including non-homogeneous transmission lines and advanced sensing technologies. Additionally, he is investigating potential solutions towards the optimised performance of active distribution networks both in off-grid and on-grid modes, to facilitate a wide suite of grid services and control capabilities. Georgios Nakas received the Dipl. Eng. degree from the Department of Electrical and Computer Engineering at the Aristotle University of Thessaloniki, Greece, in 2017 and he is currently pursuing his Ph.D. degree at the Department of Electronic and Electrical Engineering of the University of Strathclyde, Glasgow, U.K. His main research interests include electric power systems dynamic modelling and machine learning applications on dynamic security assessment in power systems with renewable generation. ###### 8.3 Challenge PI Sofia Koukoura is a Research Associate at the Department of Electronic and Electrical Engineering at the University of Strathclyde. She has a PhD on diagnostics of wind turbine gearboxes using artificial intelligence methods, through the Strathclyde Wind and Marine Energy Systems Centre for Doctoral Training. Her post-doctoral research focuses, on 38 hybrid remaining useful life methods for wind turbines, by combining data driven and physics based approached. Her research interests include signal processing, machine learning and innovative solutions for cost reduction of renewable energy. ##### References [1] T Athay, R Podmore, and S Virmani. “A practical method for the direct analysis of transient stability”. In: _IEEE Transactions on Power_ _Apparatus and Systems_ 2 (1979), pp. 573–584. [2] Dennis Bakhuis. _A_ _logistic_ _regression_ _from_ _scratch_ . URL: ``` https : / / towardsdatascience . com / a - logistic - regression ``` `from-scratch-3824468b1f88` (visited on 09/25/2020). [3] Yoshua Bengio and Y. LeCun. “Scaling learning algorithms towards AI”. In: 2007. [4] D. Erhan et al. “Why Does Unsupervised Pre-training Help Deep Learning?” In: _J. Mach. Learn. Res._ 11 (2010), pp. 625–660. [5] Alex Graves. “Long short-term memory”. In: _Supervised_ _sequence_ _labelling with recurrent neural networks_ . Springer, 2012, pp. 37–45. [6] Geoffrey E. Hinton, Simon Osindero, and Y. Teh. “A Fast Learning Algorithm for Deep Belief Nets”. In: _Neural_ _Computation_ 18 (2006), pp. 1527–1554. [7] Geoffrey E. Hinton and R. Salakhutdinov. “Reducing the Dimensionality of Data with Neural Networks”. In: _Science_ 313 (2006), pp. 504–507. [8] S. Hochreiter and J. Schmidhuber. “Long Short-Term Memory”. In: _Neural Computation_ 9 (1997), pp. 1735–1780. [9] Christoph Molnar. _Interpretable_ _Machine_ _Learning,_ _A_ _Guide_ _for_ _Making_ _Black_ _Box_ _Models_ _Explainable._ URL: `https://christophm.github.io/interpretable-ml-book/` (visited on 09/24/2020). [10] G. Lemaitre F. Nogueira D. Oliveira and C. Aridas. _imbalanced-learn_ . 2017. URL: ``` https : / / imbalanced - learn . readthedocs . io / en / stable / ``` `generated/imblearn.over_sampling.SMOTE.html` . 39 [11] Csiszar Parr Turgutlu and Howard. _Beware_ _Default_ _Random_ _Forest_ _Importances_ . URL: `https://explained.ai/rf-importance` (visited on 06/08/2020). [12] Michael Phi. _Illustrated Guide to LSTM’s and GRU’s: A step by step_ _explanation_ . URL: `http://web.archive.org/web/20080207010024/` `http://www.808multimedia.com/winnt/kernel.htm` (visited on 09/30/2010). [13] Bhavik Vachhani et al. “Deep Autoencoder Based Speech Features for Improved Dysarthric Speech Recognition”. In: _INTERSPEECH_ . 2017. 40 ## turing.ac.uk @turinginst

섹션 본문

섹션 본문이 없습니다.

참고문헌

참고문헌 정보가 없습니다.