Power transmission system fault classification method based on GA and XGBoost-RF stacking algorithm
By using GA and XGBoost-RF stacking algorithms in the fault classification of power transmission systems, combining genetic algorithms and cross-validation, the problems of insufficient performance and long calculation time of a single algorithm are solved, and more accurate fault classification and more efficient calculation process are achieved. .
Patent Information
- Application Number
- CN202411250305.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-09-06
AI Technical Summary
In the classification of power transmission system faults, a single algorithm is difficult to achieve the desired performance under different circumstances. The integrated learning method has the problem of long calculation time and is difficult to balance time and accuracy.
The fault classification method of power transmission system based on GA and XGBoost-RF stacking algorithm is adopted, and the feature data is selected through genetic algorithm, combined with the limit gradient enhancement algorithm and the random forest algorithm, fault classification is used using stacking models, and crossing with 50% and 10% Verification improves the accuracy and efficiency of the model.
It realizes a more accurate classification of power transmission system faults, breaks through the performance limitations of a single algorithm, reduces the calculation time, improves the time and accuracy balance of the overall model, and significantly improves the performance indicators of fault classification.
Smart Images

Figure CN119089322A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fault diagnosis, and in particular to a method for classifying faults in a power transmission system based on a GA and XGBoost-RF stacking algorithm. Background Art
[0002] Nowadays, fault diagnosis technology is becoming more and more important in power systems. Power systems are composed of many complex dynamic devices, which are often subject to various types of interference and thus cause faults. The ability to quickly obtain fault information and process it is of great significance to the maintenance of power systems. With the improvement of computer storage capacity and computing speed, data-driven methods have become the most popular technology in the field of fault diagnosis; in the past few decades, many methods, such as principal component analysis (PCA) and partial least squares (PLS), have been applied to fault diagnosis, but they are basically not applicable to fault classification. Fault classification aims to determine the type of fault detected, which is of great significance for designing a good industrial system.
[0003] Currently, many machine learning methods are used for fault classification, which can be considered as a multi-class classification problem in machine learning algorithms. However, current research mainly focuses on fault classification by a single algorithm. For the fault classification problem in power transmission systems, it is difficult to design a single classifier to achieve the desired performance in different situations. For example, the support vector machine (SVM) method is not good at handling multi-class problems and is sensitive to missing data. The artificial neural network (ANN) method is difficult to interpret and has many parameters that need to be adjusted. Ensemble learning methods overcome the shortcomings of a single model by voting or averaging multiple models, while improving the performance of fault classification. However, the three methods in ensemble learning also have their own advantages and disadvantages. For example, the representative algorithm of Bagging, Random Forest (RF), has two characteristics: sampling with replacement of the training set and random selection of features of each node of the tree, which makes it have better performance in classification and regression than other ensemble machine learning methods, but the model is prone to overfitting; the representative algorithm of Boosting, Extreme Gradient Boosting (XGBoost), further expands the objective function of the GradientBoosting algorithm through second-order Taylor expansion, regularization term expansion, merging coefficients and other operations, which greatly improves the calculation speed, but is too sensitive to data; Stacking can effectively improve performance indicators by stacking different models, but the calculation time is relatively longer. Summary of the invention
[0004] The present invention provides a power transmission system fault classification method based on GA and XGBoost-RF stacking algorithm to overcome the above technical problems.
[0005] In order to achieve the above object, the technical solution of the present invention is:
[0006] A method for classifying faults in a power transmission system based on a GA and XGBoost-RF stacking algorithm comprises the following steps:
[0007] S1: Obtain fault characteristic dataset of power transmission system;
[0008] The fault feature data set includes original feature data and original fault labels;
[0009] The original characteristic data includes the collected three-phase voltage data and three-phase current data at both ends of the motor under the fault state of the power transmission system;
[0010] S2: Using the accuracy function of the extreme gradient boosting algorithm XGBoost as the fitness function, and using the binary coding genetic algorithm GA to select feature data from the original feature data in the fault feature data set to obtain the optimized feature subset;
[0011] S3: randomly divide the optimized feature subset and obtain the data training set and the data test set;
[0012] S4: Use the extreme gradient boosting algorithm XGBoost as the base learner and the random forest algorithm RF as the meta-learner to obtain the XGBoost-RF stacking algorithm model;
[0013] Perform algorithm training and prediction on the XGBoost-RF stacking algorithm model through the data training set to obtain the optimized XGBoost-RF stacking algorithm model;
[0014] The algorithm prediction training includes adopting a five-fold cross validation method to train and predict the base learner according to the data training set to obtain the predicted fault label and put it into the optimized feature subset as new feature data, thereby obtaining a new data set;
[0015] The meta-learner is trained and predicted based on the new data set using the ten-fold cross-validation method, and the RF decision tree model is obtained based on the Gini coefficient used for decision tree branch node division as a probability indicator for power transmission system fault classification.
[0016] S5: Input the data test set into the optimized XGBoost-RF stacking algorithm model to obtain the power transmission system fault classification result.
[0017] Furthermore, the S2 specifically includes the following steps:
[0018] S21: using a binary coding genetic algorithm GA to encode the original feature data in the fault feature data set, and using the encoded original feature data as population individuals of an initial population of the genetic algorithm GA;
[0019] S22: The accuracy function of the extreme gradient boosting algorithm XGBoost for fault classification is used as the fitness function for calculating the fitness value of the population individuals and evaluating the performance of the feature selection results in the genetic algorithm GA;
[0020] S23: Obtain the accuracy function values of each population individual in the initial population, and use the optimal population individual corresponding to the current optimal accuracy function value as the next generation population individual;
[0021] S24: Perform selection, crossover and mutation genetic operator operations on the remaining individuals in the initial population excluding the optimal population individual to obtain the next generation of population individuals
[0022] And obtain a new population based on the next generation population individuals obtained through selection, crossover and mutation genetic operator operations and the optimal population individuals;
[0023] And take the new population as the initial population;
[0024] S25: Repeat steps S23 to S24 until a preset maximum number of iterations is reached;
[0025] The population individuals corresponding to the current optimal accuracy function value are used as the selected feature data, and the optimized feature subset is obtained based on the selected feature data.
[0026] Furthermore, S4 adopts a five-fold cross validation method to train and predict the base learner according to the data training set, which specifically includes the following steps:
[0027] S41: using a five-fold cross validation method, the data training set is divided into a first training set and a first test set;
[0028] S42: constructing a first initial decision tree model based on the extreme gradient boosting algorithm XGBoost, and obtaining the XGBoost decision tree model according to the first training set;
[0029] S43: Input the first test set into the XGBoost decision tree model to obtain the predicted fault label of the power transmission system.
[0030] Furthermore, the method for constructing the initial decision tree model is specifically as follows:
[0031] S421: Set the objective function of the t-th decision tree of XGBoost to
[0032]
[0033] Where: n represents the number of samples and sample i = 1, 2, ... n; Represents the loss function of the model, that is, the loss between the true value of the sample and the predicted value; y i represents the actual value of sample i; represents the predicted value of sample i by the first t decision trees; Ω(f t ) represents the regularization coefficient of the complexity of the tth tree, and T represents the depth of the current tree; ω represents the node value of the leaf node; γ and λ represent the hyperparameters used to control the penalty strength of the regularization coefficient;
[0034] S422: According to the principle of Boosting, the prediction value of sample i by the first t decision trees is obtained The expression is:
[0035]
[0036] Where: f t (X i ) represents the predicted value of the t-th tree for sample i;
[0037] S423: According to S422, the objective function of the XGBoost t-th decision tree is rewritten as
[0038]
[0039] And use the second-order Taylor formula to expand the objective function, then:
[0040]
[0041] Where: g i With h i represent the first-order derivative and the second-order derivative respectively, and
[0042] S424: obtaining an optimization objective function according to the objective function expanded by the second-order Taylor formula for the purpose of minimizing the objective function;
[0043]
[0044] S425: f t (X i ) is defined as in, represents the weight value of sample i on the leaf node; and according to the regularization coefficient, the optimization objective function is rewritten as
[0045]
[0046] Where: I j ={i|q(x i)=j} represents the value of the qth decision tree at the leaf node j; ω j That is The deformation form of
[0047] make Then the optimization objective function is rewritten as:
[0048]
[0049] S426: Deriving the rewritten optimization objective function and setting it to 0, then obtaining the optimal solution ω of the leaf node weight j * for
[0050]
[0051] According to the optimal solution of leaf node weights ω j * , construct an information gain function to evaluate the reliability of the classifier in predicting the results Its expression is
[0052]
[0053] S427: According to the information gain function Get the gain value Gain of each leaf node when splitting, and get the initial decision tree model according to the gain value Gain. The expression is:
[0054]
[0055] Where: Θ R It represents the optimal value of the objective function when the value is divided into the right subtree, and Θ=G,H; Θ L Indicates the optimal value of the objective function when the value is divided into the right subtree; H L , G L H represents the partition to the left subtree j , G j Value; H R , G R H represents the partition to the right subtree j , G j Value, that is: represents the fraction of the new left cotyledon, represents the fraction of the new right cotyledon, represents the score of the original leaves, and γ represents the regularization coefficient of the newly added leaves.
[0056] Furthermore, the expression of the Gini coefficient for decision tree branch node division described in S4 is:
[0057]
[0058] Where: α represents the feature used to divide the new data set using the ten-fold cross-validation method; D i represents the sub-sample set after the new data set is divided; D represents the new data set; k represents the fault category, and k=1,2,3,…,K; p k represents the probability of the kth fault category.
[0059] Beneficial effect: The present invention provides a power transmission system fault classification method based on GA and XGBoost-RF stacking algorithm, taking the extreme gradient boosting algorithm XGBoost as the base learner and the random forest algorithm RF as the meta-learner to obtain the XGBoost-RF stacking algorithm model, and combining the two algorithm models by adopting the stacking method in ensemble learning, successfully breaking through the performance limitation of the algorithm, so that the fault can be classified more accurately; in view of the problem of slow calculation time of ensemble learning, by additionally adding a genetic algorithm to the training process of the base learner for feature selection, that is, the accuracy function of the extreme gradient boosting algorithm XGBoost is used as the fitness function, and the binary coding genetic algorithm GA is used to select the original feature data in the fault feature data set to obtain the optimized feature subset, and the selected optimized feature subset has very good performance on both the base learner and the meta-learner, and due to the reduction in the number of features, the accuracy is improved while the calculation time of the overall algorithm model is reduced, so that the overall stacking algorithm model achieves a balance between time and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0061] Figure 1 It is a flow chart of a method for classifying faults in a power transmission system based on a GA and XGBoost-RF stacking algorithm of the present invention;
[0062] Figure 2 This is a flow chart of feature selection performed by the genetic algorithm in this embodiment;
[0063] Figure 3 This is a flow chart of using cross validation in this embodiment;
[0064] Figure 4 This is a flow chart of the Boosting algorithm in this embodiment;
[0065] Figure 5 This is a flow chart of the Bagging algorithm in this embodiment;
[0066] Figure 6 This is a simulation diagram of the power system verified in this embodiment;
[0067] Figure 7 This is a comparison chart of different indicators of this embodiment and other comparative machine learning algorithms;
[0068] Figure 8 This is a comparison chart of the computation time of this embodiment and other comparative machine learning algorithms;
[0069] Fig. 9 This is a core flow chart of the power transmission system fault classification method based on GA and XGBoost-RF stacking algorithm in this embodiment. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0071] This embodiment provides a power transmission system fault classification method based on GA and XGBoost-RF stacking algorithm, such as Figure 1 As shown, the following steps are included:
[0072] S1: Obtain fault characteristic dataset of power transmission system;
[0073] The fault feature data set includes original feature data and original fault labels;
[0074] The original characteristic data includes the collected three-phase voltage data and three-phase current data at both ends of the motor under the fault state of the power transmission system;
[0075] S2: Using the accuracy function of the extreme gradient boosting algorithm XGBoost as the fitness function, and using the binary encoding genetic algorithm GA to select feature data from the original feature data in the fault feature data set to obtain an optimized feature subset, specifically including the following steps:
[0076] S21: using a binary coding genetic algorithm GA to encode the original feature data in the fault feature data set, and using the encoded original feature data as population individuals of an initial population of the genetic algorithm GA;
[0077] S22: The accuracy function of the extreme gradient boosting algorithm XGBoost for fault classification is used as the fitness function for calculating the fitness value of the population individuals and evaluating the performance of the feature selection results in the genetic algorithm GA;
[0078] S23: Obtain the accuracy function values of each population individual in the initial population, and use the optimal population individual corresponding to the current optimal accuracy function value as the next generation population individual;
[0079] S24: performing selection, crossover and mutation genetic operator operations on the remaining individuals in the initial population excluding the optimal individual, so as to obtain the next generation of individuals;
[0080] And obtain a new population based on the next generation population individuals obtained through selection, crossover and mutation genetic operator operations and the optimal population individuals;
[0081] And take the new population as the initial population;
[0082] S25: Repeat steps S23 to S24 until a preset maximum number of iterations is reached;
[0083] Then the population individual corresponding to the current optimal accuracy function value is used as the selected feature data, and the optimized feature subset is obtained according to the selected feature data;
[0084] In this embodiment, the fault feature data set of the power transmission system in S1 is calculated five times by using the genetic algorithm and the extreme gradient boosting algorithm to obtain the feature set with the highest accuracy in the extreme gradient algorithm. This step belongs to the data processing part and is mainly implemented by the genetic algorithm. When the genetic algorithm is used for feature selection, it will try to select the feature subset that has the greatest improvement in model performance from the input feature set. This process is completed through operations such as crossover, mutation and selection in the genetic algorithm. Figure 2As shown in the figure, the basic principle of using genetic algorithm for feature selection is to use genetic algorithm to find the optimal binary code. In the process of feature selection, all individuals in the population are a string of random binary numbers. The length of the number is the same as the number of features to be selected. Each bit in the code represents a feature, and if the i-th bit is 1, it means that the feature is selected; if the i-th bit is 0, it means that the feature is not selected. The data set is generally x rows and y columns of data, each row is a sample, and each column is a feature. For example: when using genetic algorithm and extreme gradient boosting algorithm for feature selection, if the data set has 6 features, then the genetic algorithm will generate k 6-bit binary numbers (k is the population size set by itself), such as 001100. This row of numbers represents all samples in the data set. Only the third and fourth features are selected and input into the extreme gradient boosting algorithm for training. After all the encoding is completed, the quality of each individual is determined by calculating the fitness function. After all the judgments are completed, the individual with the largest fitness, that is, the best individual in the population, is unconditionally copied to the next generation population, and then the parent population is subjected to genetic operator operations such as selection, crossover and mutation to reproduce the next generation population. If the set number of iterations is reached, the best gene string is returned and used as the basis for feature selection. When this embodiment uses a genetic algorithm for feature selection, the accuracy (ACC) value of the target algorithm model, that is, the extreme gradient boosting algorithm, is used as the fitness function. The ACC value is calculated by a confusion matrix, and the confusion matrix is defined as follows:
[0085] Assuming there is a binary classification problem, the labels have two categories: positive and negative. The confusion matrix is as follows:
[0086]
[0087] Through the confusion matrix, we can get a series of indicators in the machine learning algorithm:
[0088] 1. Accuracy (ACC): The ratio of correctly classified samples to the total number of samples. The calculation formula is:
[0089]
[0090] 2. Precision (PRE): The proportion of correct positive example predictions, calculated as:
[0091]
[0092] 3. Recall (REC): The proportion of samples that are actually positive examples that are correctly predicted as positive examples. The calculation formula is:
[0093]
[0094] 4. F1 score: The harmonic mean of precision and recall, calculated as:
[0095]
[0096] These indicators provide comprehensive information about the performance of the classification model, which can help evaluate the performance of the model in different aspects. In the final model performance comparison process, these indicators can be used for comparison to see the pros and cons of each model.
[0097] S3: randomly divide the optimized feature subset and obtain the data training set and the data test set;
[0098] S4: Use the extreme gradient boosting algorithm XGBoost as the base learner and the random forest algorithm RF as the meta-learner to obtain the XGBoost-RF stacking algorithm model;
[0099] Perform algorithm training and prediction on the XGBoost-RF stacking algorithm model through the data training set to obtain the optimized XGBoost-RF stacking algorithm model;
[0100] The algorithm prediction training includes adopting a five-fold cross validation method to train and predict the base learner according to the data training set to obtain the predicted fault label and put it into the optimized feature subset as new feature data, thereby obtaining a new data set;
[0101] Specifically, a five-fold cross validation method is used to train and predict the base learner according to the data training set, which specifically includes the following steps:
[0102] S41: using a five-fold cross validation method, the data training set is divided into a first training set and a first test set;
[0103] S42: constructing a first initial decision tree model based on the extreme gradient boosting algorithm XGBoost, and obtaining the XGBoost decision tree model according to the first training set;
[0104] The construction method of the initial decision tree model is specifically as follows:
[0105] S421: Set the objective function of the t-th decision tree of XGBoost to
[0106]
[0107] Where: n represents the number of samples and sample i = 1, 2, ... n; Represents the loss function of the model, that is, the loss between the true value of the sample and the predicted value; y i represents the actual value of sample i; represents the predicted value of sample i by the first t decision trees; Ω(f t ) represents the regularization coefficient of the complexity of the tth tree, and T represents the depth of the current tree; ω represents the node value of the leaf node; γ and λ represent the hyperparameters used to control the penalty strength of the regularization coefficient;
[0108] S422: According to the principle of Boosting, the prediction value of sample i by the first t decision trees is obtained The expression is:
[0109]
[0110] Where: f t (X i ) represents the predicted value of the t-th tree for sample i;
[0111] S423: According to S422, the objective function of the XGBoost t-th decision tree is rewritten as
[0112]
[0113] And use the second-order Taylor formula to expand the objective function, then:
[0114]
[0115] Where: g i With h i represent the first-order derivative and the second-order derivative respectively, and
[0116] S424: obtaining an optimization objective function according to the objective function expanded by the second-order Taylor formula for the purpose of minimizing the objective function;
[0117]
[0118] S425: f t (X i ) is defined as in, represents the weight value of sample i on the leaf node; and according to the regularization coefficient, the optimization objective function is rewritten as
[0119]
[0120] Where: I j ={i|q(x i )=j} represents the value of the qth decision tree at the leaf node j; ω j That is The deformation form of
[0121] make Then the optimization objective function is rewritten as:
[0122]
[0123] S426: Deriving the rewritten optimization objective function and setting it to 0, then obtaining the optimal solution ω of the leaf node weight j * for
[0124]
[0125] According to the optimal solution of leaf node weights ω j * , construct an information gain function to evaluate the reliability of the classifier in predicting the results Its expression is
[0126]
[0127] S427: According to the information gain function Get the gain value Gain of each leaf node when splitting, and get the initial decision tree model according to the gain value Gain. The expression is:
[0128]
[0129] Where: Θ R It represents the optimal value of the objective function when the value is divided into the right subtree, and Θ=G,H; Θ L Indicates the optimal value of the objective function when the value is divided into the right subtree; H L , G L H represents the partition to the left subtree j , G j Value; H R , G R H represents the partition to the right subtree j , G j Value, that is: represents the fraction of the new left cotyledon, represents the fraction of the new right cotyledon, represents the score of the original leaf, and γ represents the regularization coefficient of the newly added leaf;
[0130] S43: inputting the first test set into the XGBoost decision tree model to obtain a predicted fault label of the power transmission system;
[0131] In this embodiment, based on the base learner, five-fold cross-validation is used to train and predict using the optimized feature subset division and the obtained data training set, that is, the extreme gradient boosting algorithm performs five-fold cross-validation again to obtain the prediction result. Among them, the k-fold cross-validation technique is used. The k-fold cross-validation is as Figure 3 shown, that is, the data set is divided k times. Each time it is divided, training and testing are performed on different data sets to obtain the results. This can avoid the contingency brought by the division of the training set and the test set, and will not lose data information. However, if the samples are already sorted according to the fault type, a large amount of information in the data will be lost when using this method. Therefore, the data should be randomly shuffled before using this method. The extreme gradient boosting algorithm (XGBoost) is one of the Boosting algorithms in the ensemble algorithm. The algorithm principle of Boosting is as Figure 4 shown. The basic component elements of the XGBoost algorithm are decision trees, and there is a sequence among these decision trees that make up XGBoost: the generation of the latter decision tree will consider the prediction result of the previous decision tree, that is, take into account the deviation of the previous decision tree, so that the training samples misclassified by the previous decision tree will receive more attention in the follow-up, and then train the next decision tree based on the adjusted sample distribution. In this embodiment, through the five-fold cross-validation calculation of the XGBoost algorithm, when different parts of the data set are used as the test set, the corresponding predicted fault classification of the test set can be obtained through the XGBoost algorithm. Next, the prediction result of the XGBoost algorithm and the optimized feature subset in S2 are combined into a new data set and imported into the random forest algorithm RF for training;
[0132] The ten-fold cross-validation method is adopted to train and predict the meta-learner according to the new data set, and the RF decision tree model is obtained based on the Gini coefficient used for decision tree branch node division as the probability index for power transmission system fault classification;
[0133] The random forest in this embodiment is a representative algorithm of the Bagging algorithm. The principle of the Bagging algorithm is as Figure 5 shown; all the base estimators of the random forest algorithm are decision trees. During the process of constructing the decision tree, n features are selected from N total features of the new data set with replacement (n < N), and the selected n features are used to train the decision tree. When the decision tree is split, m attributes (m < M) are selected from the M attributes of the samples, and then the optimal split point and split attribute are selected through information gain or Gini impurity. Generating a large number of decision trees according to this mode can obtain the RF decision tree model;
[0134] The principle of the random forest algorithm when performing the fault classification task is as follows:
[0135] The input is a data set D = {(x 1 ,y 1 ),(x 2 ,y 2 ),...,(x m ,y m )}, where x i , i=1,2,……m is the i-th sample, y i , i=1,2,…m is the i-th label, the number of weak classifiers is T, and the output is the final strong classifier f(x);
[0136] For i = 1, 2, ..., T, the following definitions apply:
[0137] 1. Sampling the training set for the tth time, a total of m times, to obtain a sampling set D containing m samples t ;
[0138] 2. If the data set has N features, use the sampling set D t Train the tth decision tree model G t (x), when the decision tree is splitting nodes, randomly select all the features features, and select the best feature from the selected features for node division;
[0139] The node division of the t-th decision tree is determined by judging the features by information entropy or Gini coefficient. In this embodiment, the Gini coefficient is used to judge the features.
[0140] The Gini coefficient indicates the probability of misclassification of a randomly selected sample in a data set. The smaller it is, the smaller the probability of misclassification of the selected sample. The formula is defined as follows:
[0141]
[0142] Where D is the data set, k = 1, 2, ... K represents the kth category, p k Represents the probability of the kth category. Using the Gini coefficient to select the optimal partitioning feature is to compare the difference in the Gini coefficients after different feature partitions, and select the feature with the largest reduction in the Gini coefficient.
[0143]
[0144] Among them, α represents the feature used in this division, D i Represents the sub-sample set after division. This formula represents the use of the data set before division minus the sub-data set D after division. i The weighted sum of the Gini coefficients;
[0145] In the branching process of the decision tree, the feature partitioning node with the smallest Gini coefficient is always selected until the complete RF decision tree model is constructed;
[0146] 3. All T classifiers determine the fault category through majority voting. Majority voting refers to the random forest algorithm in x i When performing classification, each tree in the random forest algorithm performs a i Make predictions. When all trees have finished predicting, take the category predicted by the largest number of trees in the random forest algorithm as x i Category.
[0147] S5: Input the data test set into the optimized XGBoost-RF stacking algorithm model to obtain the power transmission system fault classification result.
[0148] In this embodiment, in order to verify the effectiveness of the present invention in the classification of power transmission system faults, Matlab was used for simulation to pre-establish a 400×10 3 V three-phase transmission line system. Figure 6 As shown, the system consists of two 400×10 3 The system is composed of a generator of V, each located at both ends of the transmission line, to simulate and study various faults at different locations on the transmission line. The line was modeled using distributed type parameters so that more accurate results can be obtained when implementing the proposed scheme on ultra-long transmission lines. The three-phase VI measurement block in the SimPowerSystem toolbox is used to measure the three-phase voltage and current samples of each end a as the characteristics of the data set. The transmission line length is 300km, and different types of faults are detected at different locations along the length of the transmission line. The system has four outputs, namely A (phase A), B (phase B), C (phase C), and G (ground end). The output is 0 or 1, indicating that there is no or no fault on the corresponding line. Finally, 7860 samples were sampled, with a total of 6 fault types. The specific fault types are shown in the table below:
[0149] Table 1. Fault categories of three-phase circuit system
[0150] G C B A Fault category 0 0 0 0 No trouble 1 0 0 1 LG fault (between phase A and GND) 0 0 1 1 LL fault (between phase A and phase B) 1 0 1 1 LLG fault (between phase A, B and GND) 0 1 1 1 LLL fault (between three phases) 1 1 1 1 LLLG fault (three-phase symmetrical fault)
[0151] After obtaining the data set, the power transmission system fault classification method based on GA and XGBoost-RF stacking algorithm in this implementation is used to classify faults, and the corresponding ACC, PRE, REC, and F1 score indicators are obtained, and compared with the classic machine learning algorithm. This verification uses RF algorithm, SVM algorithm, adaptive boosting (AdaBoost) algorithm, gradient boosting (GBC) algorithm and XGBoost algorithm to classify faults and obtain a series of indicators. The comparison results are as follows Figure 7In addition, in order to compare the algorithm running time, the running time of the power transmission system fault classification method based on GA and XGBoost-RF stacking algorithm and the algorithm used as the comparison on the data set was obtained. The standard is the average running time of five consecutive runs. The comparison results are shown in Figure 8 shown.
[0152] The test conclusion of this embodiment is: Figure 7 It can be concluded that the performance of the power transmission system fault classification method based on the GA and XGBoost-RF stacking algorithm provided in this embodiment under this data set far exceeds that of other comparison algorithms, and the maximum values are obtained in all four indicators; Figure 8 It can be concluded that the power transmission system fault classification method based on the GA and XGBoost-RF stacking algorithm has reached the level of a single algorithm in terms of running time. The two major algorithm pros and cons judgment criteria of comprehensive time and accuracy verify the rationality and effectiveness of the power transmission system fault classification method based on the GA and XGBoost-RF stacking algorithm in fault classification.
[0153] The overall beneficial effects of this implementation are as follows: First, a single machine learning algorithm is difficult to obtain accurate results in the power system due to its own performance limitations, which may lead to additional consumption of resources. Fig. 9 As shown, this embodiment adopts the stacking method in ensemble learning to combine the two models, successfully breaking through the performance limitation of the algorithm, so that the fault can be classified more accurately. In addition, in view of the advantages and disadvantages of the three ensemble learning methods and different algorithms, the extreme gradient boosting algorithm is selected as the base learner, and the random forest algorithm is selected as the stacking form of the meta-learner, that is, the three major modes of Bagging, Boosting, and Stacking in the ensemble learning algorithm are combined, so that the accuracy and other indicators are further improved. Finally, in view of the problem of slow computing time of ensemble learning, this embodiment adds a genetic algorithm to perform feature selection during the training of the base learner. The selected feature subset has very good performance on both the base learner and the meta-learner, and due to the reduction in the number of features, the accuracy is improved while the computing time of the overall algorithm model is reduced, so that the overall stacking algorithm model achieves a balance in time and accuracy. This method can not only help prosecutors to make auxiliary judgments in fault classification decisions, but also provide experience for the performance research of the stacking algorithm.
[0154] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A power transmission system fault classification method based on GA and XGBoost-RF stacking algorithm, characterized in that: The following steps are involved: S1: Obtain fault characteristic dataset of power transmission system; The fault feature data set includes original feature data and original fault labels; The original characteristic data includes the collected three-phase voltage data and three-phase current data at both ends of the motor under the fault state of the power transmission system; S2: Using the accuracy function of the extreme gradient boosting algorithm XGBoost as the fitness function, and using the binary coding genetic algorithm GA to select feature data from the original feature data in the fault feature data set to obtain the optimized feature subset; S3: randomly divide the optimized feature subset and obtain the data training set and the data test set; S4: Use the extreme gradient boosting algorithm XGBoost as the base learner and the random forest algorithm RF as the meta-learner to obtain the XGBoost-RF stacking algorithm model; Perform algorithm training and prediction on the XGBoost-RF stacking algorithm model through the data training set to obtain the optimized XGBoost-RF stacking algorithm model; The algorithm prediction training includes adopting a five-fold cross validation method to train and predict the base learner according to the data training set to obtain the predicted fault label and put it into the optimized feature subset as new feature data, thereby obtaining a new data set; The meta-learner is trained and predicted based on the new data set using the ten-fold cross-validation method, and the RF decision tree model is obtained based on the Gini coefficient used for decision tree branch node division as a probability indicator for power transmission system fault classification. S5: Input the data test set into the optimized XGBoost-RF stacking algorithm model to obtain the power transmission system fault classification result.
2. According to claim 1, a power transmission system fault classification method based on GA and XGBoost-RF stacking algorithm is characterized in that: The S2 specifically includes the following steps: S21: using a binary coding genetic algorithm GA to encode the original feature data in the fault feature data set, and using the encoded original feature data as population individuals of an initial population of the genetic algorithm GA; S22: The accuracy function of the extreme gradient boosting algorithm XGBoost for fault classification is used as the fitness function for calculating the fitness value of the population individuals and evaluating the performance of the feature selection results in the genetic algorithm GA; S23: Obtain the accuracy function values of each population individual in the initial population, and use the optimal population individual corresponding to the current optimal accuracy function value as the next generation population individual; S24: performing selection, crossover and mutation genetic operator operations on the remaining individuals in the initial population excluding the optimal individual, so as to obtain the next generation of individuals; And obtain a new population based on the next generation population individuals obtained through selection, crossover and mutation genetic operator operations and the optimal population individuals; And take the new population as the initial population; S25: Repeat steps S23 to S24 until a preset maximum number of iterations is reached; The population individuals corresponding to the current optimal accuracy function value are used as the selected feature data, and the optimized feature subset is obtained based on the selected feature data.
3. According to claim 1, a method for classifying power transmission system faults based on GA and XGBoost-RF stacking algorithm is characterized in that: S4 uses a five-fold cross-validation method to train and predict the base learner based on the data training set, which specifically includes the following steps: S41: using a five-fold cross validation method, the data training set is divided into a first training set and a first test set; S42: constructing a first initial decision tree model based on the extreme gradient boosting algorithm XGBoost, and obtaining the XGBoost decision tree model according to the first training set; S43: Input the first test set into the XGBoost decision tree model to obtain the predicted fault label of the power transmission system.
4. According to claim 3, a method for classifying power transmission system faults based on GA and XGBoost-RF stacking algorithm is characterized in that: The construction method of the initial decision tree model is specifically as follows: S421: Set the objective function of the t-th decision tree of XGBoost to Where: n represents the number of samples and sample i = 1, 2, ... n; Represents the loss function of the model, that is, the loss between the true value of the sample and the predicted value; y i represents the actual value of sample i; represents the predicted value of sample i by the first t decision trees; Ω(f t ) represents the regularization coefficient of the complexity of the tth tree, and T represents the depth of the current tree; ω represents the node value of the leaf node; γ and λ represent the hyperparameters used to control the penalty strength of the regularization coefficient; S422: According to the principle of Boosting, the prediction value of sample i by the first t decision trees is obtained The expression is: Where: f t (X i ) represents the predicted value of the t-th tree for sample i; S423: According to S422, the objective function of the XGBoost t-th decision tree is rewritten as And use the second-order Taylor formula to expand the objective function, then: Where: g i With h i represent the first-order derivative and the second-order derivative respectively, and S424: obtaining an optimization objective function according to the objective function expanded by the second-order Taylor formula for the purpose of minimizing the objective function; S425: f t (X i ) is defined as in, Represents the weight value of sample i on the leaf node; And according to the regularization coefficient, the optimization objective function is rewritten as Where: I j ={i|q(x i )=j} represents the value of the qth decision tree at the leaf node j; ω j That is The deformation form of make Then the optimization objective function is rewritten as: S426: Deriving the rewritten optimization objective function and setting it to 0, then obtaining the optimal solution ω of the leaf node weight j * for According to the optimal solution of leaf node weights ω j * , construct an information gain function to evaluate the reliability of the classifier in predicting the results Its expression is S427: According to the information gain function Get the gain value Gain of each leaf node when splitting, and get the initial decision tree model according to the gain value Gain. The expression is: Where: Θ R It represents the optimal value of the objective function when the value is divided into the right subtree, and Θ=G,H; Θ L Indicates the optimal value of the objective function when the value is divided into the right subtree; H L , G L H represents the partition to the left subtree j , G j Value; H R , G R H represents the partition to the right subtree j , G j Value, that is: represents the fraction of the new left cotyledon, represents the fraction of the new right cotyledon, represents the score of the original leaves, and γ represents the regularization coefficient of the newly added leaves.
5. According to claim 3, a method for classifying power transmission system faults based on GA and XGBoost-RF stacking algorithm is characterized in that: The expression of the Gini coefficient used for decision tree branch node division described in S4 is: Where: α represents the feature used to divide the new data set using the ten-fold cross-validation method; D i represents the sub-sample set after the new data set is divided; D represents the new data set; k represents the fault category, and k=1,2,3,…,K; p k represents the probability of the kth fault category.
Citation Information
Patent Citations
Fault diagnosis method for oil-immersed transformer
CN116263814A
Transfer-learning-based life prediction and health assessment method for aero-engine
WO2023231995A1
Cited By
Financial system drill scene key fault risk analysis method based on tree model
CN120125346A
Key Fault Risk Analysis Method for Financial System Drill Scenarios Based on Tree Model
CN120125346B
