EM-TSA: An ensemble machine learning-based transient stability assessment approach for operation of power systems

: The transient stability of power systems plays the key role in their smooth operation, which is inﬂuenced by many working condition factors. To automatically evaluate transient stability status precisely for power systems remains a practical issue. To realize data-driven evaluation for the transient stability of the power systems, this paper proposes an ensemble machine learning-based assessment approach for transient stability status of power systems, which is named as EM-TSA for short. The experiments prove that the proposed model outperforms each secondary learning model and the traditional deep learning model in terms of accuracy and safety indexes. Considering the e ﬀ ect of noise, the experiments are repeated by adding Gaussian noise to the original test set. The results show that the ensemble learning model can maintain 98.4% accuracy under various noisy environments. In addition, the proposed model is combined with the sample transfer learning algorithm when the system topology is changed. An online update method for transient stability models is proposed, and compared with the previous approaches, the proposed algorithm can adapt to the online update of transient stability assessment models.


Introduction
As society's dependence on electricity has been increasing, electricity has become the main source of energy consumed in people's daily life and production [1].As the main energy consumed in our daily life and production, and the electric power industry has become a basic industry of the national economy [2] and has also become a basic industry related to social development [3].Without effective and timely control measures, the power systems may lose the ability of stable operation [4].A chain failure or even collapse may occur, resulting in a large-scale power outage, bringing huge economic losses and catastrophic social impacts, and even endangering personal safety [5].
The planning, design, operation and other work of the power system are inseparable from a large amount of transient stability assessment [6].The occurrence of transient instability will certainly lead to unhealthy running or even disintegration of power systems [7].This results in large-scale power outages, bringing huge losses to the national economy and bad effects to social life [8].Therefore, through a large amount of power system transient stability assessment, preventive control technology means or emergency control measures can be taken before the occurrence of instability [9].This is of great practical significance for more secure and stable smart grid systems [10].Transient Stability Assessment (TSA) refers to the assessment of the ability of the power system to maintain synchronous operation and return to the original stable operation state or transition to the new operation state after a large disturbance [11].The disturbances that may cause transient stability problems are mainly the following: (1) the occurrence of short-circuit faults; (2) the commissioning of loads; (3) the commissioning of major components such as generators, transformers or lines.Among them, the disturbance caused by a short-circuit fault has the greatest impact on the system, and the transient stability is often tested by the operation under a short-circuit fault [12].
Universally, it is important to achieve a balance between electromagnetic torque of generators and torque of prime movers.When the disturbance occurs, this balance is broken, and the unbalanced torque acts on the rotor, making the work angle and speed of each generator change.Relative oscillation occurs between the generator sets, forming an electromechanical transient process with the mechanical motion of each generator rotor [13].There are two possible results of the electromechanical transient process.One is that after a period of oscillation, the oscillation gradually decays, and the generators continue to maintain synchronous operation, in which case the system is transient stable [14].The other is that the oscillation cannot decay and gradually expands, the generators cannot maintain synchronous operation, and the system is transient unstable, also called system instability [15].Therefore, the characteristics of the power angle of each generator along with time after suffering a large disturbance are often used as the criteria of the transient stability of the power system.When the system is destabilized, it is required to take some emergency control measures to prevent the disturbance from continuing to expand and causing system islanding or even widespread power outage accidents [16].
To this end, it is necessary to perform the transient stability assessment accurately during the operation of the system [17], so as to timely discover large disturbances such as cutting machine and cutting load during the operating process of smart grids [18].Hence, the whole system can be completed in time to assess the transient stability of early warning and take effective measures to prevent the occurrence of failure [19].The transient stability analysis and the control theory of the system have been perfected, and fruitful results have been achieved [20].However, the power system becomes intelligent and data-oriented with the development of artificial intelligence and big data technology.The time domain simulation method and numerical analysis method alone can no longer meet the needs of the modern power system, and they also do not meet the development trend of the power system intelligence and data orientation.Based on the real-time online operation data of the power system, it is an important task to analyze the stability of the power system [21].With the rise of artificial intelligence, the interdisciplinary technology of combining deep learning technology with transient stability assessment has become more and more mature [22].More and more scholars and experts have proposed relevant basic theories and training algorithms to promote the TSA in power systems.The basic principle of using machine learning theory for TSA in power systems is to use the ability of the assessment model to process data information, extract the unknown functional relationship between them through a large amount of data training, and use the obtained functional relationship as the assessment standard for discrimination.
In this paper, we explore the ensemble learning to predict the transient stability of a power system.Motivated by the challenge of this issue and the previous research, an ensemble learning model is proposed, and the predicted values corresponding to multiple machine learning models are learned twice to obtain the final prediction results.An online update method for transient stability models is proposed, in which the ensemble learning is combined with the sample transfer learning algorithm when the system topology is changed.

Related work
The time-domain simulation method, also known as the indirect method, is the most technically mature method for this purpose, and the main source for offline acquisition of data in machine learning methods.First, a detailed mathematical model of each component in the system needs to be established, and then the topological connection relations of each component in the system are constructed.The two are combined to establish a full-system model of the system to be analyzed, and a set of nonlinear differential equations is used to describe the whole system.The numerical integration method is adopted to solve the set of problems, and the stable operation state or the tidal current solution is utilized as the initial value of the equations to solve the dynamic process of the variables in the system under the disturbance condition with time, and to determine whether the system is temporarily stable according to the change of the relative angle between the rotors of each generator.The time-domain simulation method has the advantages of wide application and accurate results, but its disadvantages of large computational volume and long computational time make it difficult to meet the real-time requirements of online transient stability assessment.At present, people are still continuously proposing new improvements and innovations to the time-domain simulation method.In the work [14], an index for quantitative analysis of generator stability is proposed based on the trajectory of generator energy after disturbance.The work [15] utilized the higher-order Taylor series method to significantly improve the computational speed of the time-domain simulation while ensuring the accuracy of the calculation.The work [16] proposed a variety of termination criteria for time-domain simulation to reduce the number of steps of numerical integration and improve the computational efficiency.The work [17] proposed a generalized polynomial chaos approach that allows the analysis of transient stability that results in the presence of uncertainties such as random fluctuations of load.The works [23] and [24] combined explicit and implicit integration to further improve the integration efficiency.
As new energy sources are continuously connected to the grid, and the system scale becomes more and more complex, the new development of the current power system puts forward higher requirements for TSA, and traditional methods (such as time-domain simulation) face serious challenges in terms of applicability, evaluation and prediction speed.The development of machine learning has provided new possibilities for breakthroughs in both, and TSA methods based on machine learning have become a frontier topic in the field of power system research.Compared with traditional TSA methods, machine learning methods establish the mapping relationship between physical quantities of power systems and assessment results by autonomous training models from the perspective of pattern recognition, and they use the trained models to analyze the newly generated samples in the system.In recent years, numerous scholars have analyzed and improved the TSA of power systems based on machine learning.Most of them utilized basic machine learning methods such as k-nearest neighbor (KNN), random forest (RF) [19], support vector machine (SVM) [24], gradient boosting decision tree (GBDT) [21,22], logistic regression (LR), AdaBoost [25], etc.
Although various intelligent algorithms can contribute a lot to the optimal running and effective scheduling of power systems, the security which acts as the foundation cannot be ignored.In this branch, some researchers have also paid considerable research attention, so as to complete research of a smart grid.Jian et al. [26] proposed a data-driven based security awareness framework for power systems.Gonzalez et al. [27] tried the convolutional neural network based approach for static security assessment of power systems.Chen [28] and Salehi [29] also explored power system analysis and security monitoring by machine learning based approaches.However, the previous work fails to capture the dynamic variation of a power system with limited training data, and the model could be portable for use in a new situation.Motivated by this, we proposes an ensemble machine learning-based transient stability assessment approach to tackle those issues in this paper.

Ensemble learning
Transient stability refers to the status of whether the power systems can transit to a new operating state or return to the original operating state under a certain operating mode.This status can be determined according to operating indexes of power systems.Therefore, the inputs are operating indexes of power systems, and the outputs are calculated the results of Transient Stability Assessment).In supervised learning algorithms, the objective is to train a stable model that performs well in all aspects.However, the actual situation is often not ideal, and only some models with preferences that perform better in some aspects can be obtained, which are weakly supervised models.The EM-TSA proposed in this paper obtains a better and more comprehensive strongly supervised model by combining these existing weakly supervised models.In this way, even if a weak classifier makes an error when testing a data set that it is not good at, others could correct the error in time.
The general structure of ensemble learning is to first train multiple base learners and then integrate them into a more robust learner.By integrating multiple base learners to complement each other's strengths, ensemble learning can achieve better performance than a single learner.By the way of base learner generation, ensemble learning can be divided into two categories: One is the ensemble learning algorithm represented by Boosting, in which there is a dependency between base learners, and must be generated serially; the other is the ensemble learning algorithm represented by Bagging, in which there is no dependency between learners, and can be generated in parallel, as shown in Figure 2.
Bagging algorithm is the classical algorithm for parallel ensemble learning.In order to make the ensemble base learners as independent as possible, the Bagging algorithm can randomly pick multiple training subsets from the input data set by the self-sampling method, then train multiple base learners based on the training subsets, and finally combine the base learners to form a whole.However, the self-sampling method is mainly for the case of small data sets, and when the data volume is large, using the self-sampling method will instead cause a decrease in learner accuracy due to the lack of data volume.Therefore, in this paper, we use the traversal method to import the original data into seven trainers for training, respectively, and finally obtain the total classifier by the integration method.For different integration learning, there can be many integration methods.For example, the function values obtained from different learners can be averaged to get the final result, or it can be obtained by weighted average.In this paper, the predicted values of the sample data sets of different models are obtained by training different models, and according to the labels of these predicted values with the training data, they are substituted into the new machine learning model for secondary training.Finally, they are tested with a test set.This is the idea of integrating the results of multiple classifiers in this paper.The integration learning training process is as follows.
2) Train the base learner, which can be expressed as follows.
Model i = M i train(S train ) (3.3) where the Model train and Model predict represent the training process and the testing process, respectively.
3) Construct new data set S new , which integrates all the training data sets together.
S new = {y 1 train , y 2 train , ..., y 7 train , } 4) Train the new data set with the meta-learner, which can be expressed as follows.
Model Meta = Model train(S new ) (3.7) 5) Import the test set into the model to derive prediction results.

Transfer learning
As the scale of data to be recorded in a power system is getting larger and larger, the system features are getting more and more.However, the utilization rate of these data is not high.The main reason is that the power system is a time-varying system, and its time-varying nature is reflected in the timevarying data and time-varying system structure.With the continuous development of deep learning, how to make good use of historical data is a critical issue to improve the efficiency of transient stability assessment.Transfer learning in artificial intelligence and machine learning refers to an idea and mode of learning.The problem solved by machine learning is to enable machines to acquire knowledge from data autonomously and get the mapping relationship between data and results through input data and results.Transfer learning focuses on transferring the learned knowledge from old problems to new problems.In order to achieve the knowledge transfer successfully, the core target of transfer learning is to find the similarity between the new problem and the original problem.
The basic approaches of transfer learning include sample transfer, feature transfer, model transfer, and relationship transfer.In this paper, we conduct experiments on two of the more cutting-edge approaches in transfer learning.For the sample-based transfer learning approach, data samples are reused for transfer learning based on certain weight generation rules, such as the TrAdaBoost approach [23].For feature-based transfer method, it migrates each other by means of feature transformation to reduce the gap between source and target domains, such as transfer component analysis proposed in the work [24].This makes the impact of some source domain data on the target domain different as well.For example, the TrAdaBoost algorithm is precisely based on the AdaBoost algorithm, where the features of the source domain are weighted and iterated, and a classifier is trained with each weighting, and the update strategy of the weights is decided by the good or bad performance of this classifier.By setting a distance function as the target value and establishing an optimization model with this function

Mathematical Biosciences and Engineering
Volume 20, Issue 5, 8226-8240.as the target function, the features with the highest correlation between the source and target domains are extracted.The distribution adaption is to use the source domain and the target domain marginal probability distribution to approximate the difference between the two domains: where d(D s , D t ) denotes the distance between the edge probability distribution of the source domain and the target domain, and P(x t ) denote the edge probability distributions of the data in the source domain and the target domain, respectively.However, since the characteristics of the source domain and the target domain are not identical, the probabilities of the edge distributions of the two data are not equal.Therefore, it is not possible to directly reduce the distance between the two.The transfer component analysis makes the mapped data distribution satisfy the equation 10 by assuming that there exists a feature mapping ϕ in the space.Then, the conditional distributions of the two domains after the mapping will also be close to each other.Thus, training classification for machine learning can be performed.
TCA measures the degree of similarity between two distributions by constructing maximum mean discrepancy (MMD).
where x i , x j represent the source domain data and the target domain data, respectively; N 1 , N 2 denote the number of samples in the source and target domains, respectively; ϕ denotes the mapping function; H denotes that this distance is measured by ϕ mapping the data into the regenerated Hilbert space.

Evaluation
The transient stability status can be determined according to operating indexes of power systems.Machine learning-based methods can be formulated to establish a mapping from features (operating indexes of power systems) to discriminative results (transient stability status).Therefore, the inputs are operating indexes of power systems and the outputs are calculated statuses about "Transient Stability Assessment."In our experimental data, there are 448 features in the initial dataset which is input for training.For the final result, it is with the format of an one-dimensional data, because the discriminative result is just a single numerical value that describes such status degree.
The input sample set is obtained by IEEE-10 machine 39 node system simulation calculations, where the generator is a classical second-order model, and the load impedance model is a constant impedance.The system is assumed to have a three-phase short-circuit fault at 0.1 second.The fault is removed, and the original topology of the system is kept unchanged for four moments at 0.2 second, 0.35 second, 0.38 second, and 0.4 second, respectively.The simulation lasts for 3 seconds before ending.The load level is increased by 5% each time from 80% to 130% for a total of 11.The corresponding generator output is matched according to the different load levels to ensure the power balance of the system and to maintain the voltage fluctuation of each bus within a reasonable range.With the help of simulation software, the system data under the above fault conditions are calculated, and 5643 data samples are generated, of which 3946 are stable samples, and 1697 are unstable samples.
The 5643 training samples obtained from the simulation are fully labeled and randomly divided into two copies, one with 4643 training samples and the other with 1000 test samples.The parameters of the deep belief network (DBN) model are known; the number of layers of the ANN model is the same as that of the DBN.The number of input neurons and the number of output neurons are determined by the input feature vector and the output category.The DT model used for classification purposes is the C4.5 algorithm and is introduced.There, the confidence factor is set to the default value; the kernel function of SVM is radial basis function (RBF).The parameters of the model structure were determined by 5-fold cross-validation and grid search method.
Transient stability assessment of power systems is a typical class of non-equilibrium classification   [2], and the damage caused by the missed or misjudgment of instability is obviously much greater than that caused by the misjudgment of maintaining stability.The use of a single accuracy criterion to evaluate the model performance is not objective enough, so the failure rate index is introduced to comprehensively evaluate the evaluation performance of the TSA model.There, the confusion matrix of transient stability assessment, true positive (TP) and false negative (FN) are the numbers of stable samples being correctly or incorrectly assessed, and false positive (FP) and true negative (TN) are the numbers of destabilized samples being correctly or incorrectly assessed.The first metric is the accuracy rate, which represents the overall performance of the classifier in classifying the test samples, and the expression is The second metric is the stability rate, which is the percentage of correct predictions among all samples with stable true labels, reflecting the security of the classifier in handling TSA problems.
The third metric is the percentage of unstable samples that are correctly predicted among all samples with unstable true labels, which mainly reflects the reliability of the classifier in dealing with TSA problems, and the expression is The fourth metric is the geometric mean of the above two rates, and its expression is In order to obtain the most effective integration method, the predictions obtained by the 7 ensemble learning algorithms were used as the training set, and a set of 6530 sets of 7-dimensional features was obtained as a sample training set.After traversing the 7 algorithms and the 8 models with mean values and training them, the model evaluation metrics with the 8 methods were tested, and the test results of each evaluation model are shown in Table 1.The performance of Ac, T S R, T UR, Gmean are shown as Figures 3 and 4, respectively.In TSA, the security TSR parameter is clearly more important than the reliability TUR parameter.Therefore, the performance exhibited by the learning model is significantly higher than that of each classifier model before integration.In this paper, the proposed learning algorithm is compared with the deep learning algorithms CNN and LSTM, where CNN uses three one-dimensional convolutional layers.The number of convolutional neurons is 32, 64, 64, the size of convolutional kernel is 6, and the training period is 60.The LSTM has two layers, the number of hidden layers in each layer is 400, 200, the L1 regularization coefficients are 0.005, 0.005, the sparse parameters are 0.15, 0.05, and the training period is 200.The performance of the two was analyzed, as shown in Figure 5.
Table 2 compares the training speed of the proposed model with the deep learning models CNN and LSTM.After the comparison, it is found that the proposed model has a better training speed, but it takes slightly longer to predict a single sample.In order to better simulate the actual system operation, the data may generate errors during the measurement and transmission, and this paper adds noise conforming to the Gaussian distribution to the data.Figure 6 shows the accuracy and safety parameter values of the learning model and each classifier involved in the integration, respectively, in the noisy environment.From Figure 6, it can be seen that the learning is more resistant to noise, and the accuracy of the model prediction is always maintained at 98.4%, and the difference between the two performances gradually increases as the noise increases.Except for the machine learning methods appearing in the figure, the accuracy of the other methods decreases to a large extent under the interference of noise.Especially, the accuracies of KNN algorithm and RF algorithm decreases to 89.8% and 95.2%, respectively.
By using the TCA algorithm, the data generated after the topology change is used to migrate the features with the historical data before the topology change, and then obtain a large amount of simulation data.In this paper, the TCA method takes Gaussian kernel function for calculation, the width of kernel function is 1, the feature dimension is 30, and the samples with different offsets are migrated separately to obtain different sample sets for training the model.The test results are shown in Figure 7.By comparison, it is found that the TrEnsemble method shows high prediction accuracy when only a small number of training samples are available, and the accuracy increases when the training samples are increased.Meanwhile, the TCA method is essentially a feature migration method, so it is actually not sensitive to the training sample size, and its accuracy remains basically stable.

Conclusion
In this paper, an ensemble learning algorithm named as EM-TSA is proposed and introduced into the transient stability assessment of power systems.In this paper, the predicted values corresponding to multiple machine learning models are learned twice to obtain the final prediction results.Considering the effect of noise, the experiments are repeated by adding Gaussian noise to the original test set.The results show that the EM-TSA can maintain high accuracy under various noisy environments.The proposed EM-TSA combined with the sample transfer learning algorithm is proposed to deal with the system topology changing.Compared with the previous approaches, the proposed method can adapt to the online update of transient stability assessment models.

Figure 1 .
Figure 1.A scenario of a power system.

Figure 2 .
Figure 2. A schematic illustration of ensemble learning model.

Figure 3 .
Figure 3.The performance comparison of Ac and TSR.

Figure 4 .
Figure 4.The performance comparison of TUR and Gmean.

Figure 5 .
Figure 5.The performance comparison of CNN and LSTM.

Figure 6 .
Figure 6.Comparison of accuracy for models under the interference of noise.

Figure 7 .
Figure 7.Comparison of accuracy for transfer learning.

Table 1 .
Comparison of performance results.

Table 2 .
Time consumption with different models.