Abstract

Power quality disturbances (PQDs) can lead to significant operational and financial losses in power systems. Accurate detection and classification of PQDs are essential for maintaining power quality and preventing power system failures. This research article introduces an innovative approach for the precise detection and classification of single- and multiple-state power quality disturbances (PQDs) using the Stockwell transform (ST) and a random forest classifier. To create realistic PQD signals, seventeen distinct classes are generated in accordance with IEEE Standard 1159, employing mathematical equations implemented in MATLAB software. The ST is employed to extract relevant features from the PQD signals, which are subsequently utilized as input for the random forest classifier. The classifier employs bootstrapping sampling to generate multiple training sets from the original dataset. Each training set is used to construct a decision tree by recursively partitioning the data based on significant features. To mitigate overfitting and enhance robustness, a random subset of features is selected at each node of the decision tree, thereby reducing tree correlation. The performance of the random forest classifier is compared with other widely utilized machine learning classifiers. The results exhibit the efficacy of the proposed approach in accurately detecting and classifying PQ events, highlighting its superiority over alternative methods.

1. Introduction

In the last few years, power quality (PQ) problems have come up because smart grid technology and irregular loads have been added to power systems. These problems are caused by nonlinear loads such as electronic converters and variable-speed drives, which cause voltage drops, harmonics, interruptions, and other problems. Generations residing in different places have added to the problem. To deal with these problems successfully, disruptions need to be found and put into the right classifications. Researchers have used signal processing and machine learning to look at PQ data and extract features that can be used to classify it [1, 2]. Accurately detecting and classifying power quality problems is important for keeping power systems reliable, figuring out what causes them to be unreliable, and coming up with ways to fix them. Also, it helps build more advanced tracking and control systems that can adapt to changes in the grid. As power systems change and incorporate new control technology and green energy sources, it will become more important to deal with power quality issues. Modern power systems need to keep researching PQ analysis methods in order to work well and last for a long time [3].

The precise detection and classification of power quality disturbances (PQDs) are essential for maintaining a reliable power supply, protecting electronic equipment, and enhancing power system performance. By identifying and classifying these disturbances, suitable measures can be taken to mitigate their negative effects. Understanding the causes and sources of PQDs enables targeted solutions to minimise their occurrence and improve power system resilience [4]. This is especially important in modern power systems that integrate sensitive electronic equipment and renewable energy. A continued focus should be placed on the development of advanced techniques for detecting, classifying, and mitigating PQDs to ensure a high-quality power supply and efficient operation of the power system. Correctly categorizing the signals of PQDs, especially complex signals, becomes extremely difficult in tough and noisy conditions. Many researchers have studied how to best categorize PQDs during the past few decades. Feature extraction and classification are the two key components of these strategies. The first stage is to use signal processing methods to glean useful information from the PQ noise [5]. This step is crucial because it helps distinguish between different kinds of disruptions, which is necessary for later classification. For the successful implementation of classification, improved recognition at the feature extraction stage is crucial [6].

Power quality disturbances encompass various issues such as sag, swell, interruptions, voltage fluctuations, harmonics, notching, and transients. Accurately detecting and classifying PQDs in power systems is crucial for identifying their causes and implementing appropriate solutions. This research aimed to address this challenge by leveraging advanced machine learning techniques to effectively identify and classify PQDs based on their specific characteristics. The detection and classification of PQDs are particularly challenging due to the complex and overlapping nature of the signals involved. Successful identification and classification of PQDs require both robust feature extraction techniques and efficient classifiers. By developing suitable methods for feature extraction and implementing effective classification algorithms, this research contributes to the field of power quality analysis and facilitates the identification and mitigation of PQDs [7]. Once PQD signals are generated, signal processing techniques are employed to extract relevant features from signals belonging to different classes. These extracted features are utilized to train a machine learning classifier, enabling the identification of various PQDs. Subsequently, the features of the test signal data are fed into the trained classifier, allowing the classification of each PQD using machine learning methods [8].

1.1. Literature Review

A robust detection technique is required to identify power quality issues across a wide frequency range, spanning from high-frequency sharp changes up to 1 kHz to low frequencies of 50 Hz. This technique should possess the ability to extract features and classify power quality events with robustness while maintaining low space and time complexity in its implementation. However, signal processing techniques face limitations due to Heisenberg’s uncertainty principle, which hinders the simultaneous enhancement of time and frequency resolution. The Fourier transform (FT) offers excellent frequency resolution but lacks time resolution, rendering it inadequate for real-time power signal analysis. The short-time Fourier transform (STFT) divides nonstationary signals into windows, yet it suffers from improper window size selection. Wavelet transform (WT) overcomes some limitations but exhibits higher technical complexity and performance degradation in noisy environments. To address these challenges, the S-transform (ST) combines the advantages of WT and STFT, enabling robust noise resistance and accurate detection of both low- and high-frequency events. ST constructs a feature matrix utilizing frequency-dependent resolution, which can be effectively employed for the classification of power quality events using machine learning classifiers [9].

As mentioned earlier, power quality interruptions have a negative impact on system efficiency. The literature suggests various smart approaches for automatic recognition of PQDs [10]. These approaches typically involve two main steps: (i) signal analysis and feature extraction and (ii) PQD classification. Signal analysis techniques such as Fourier transform (FT) [11], short-time Fourier transform (STFT) [12, 13], wavelet transform (WT) [14, 15], and S-transform (ST) [16] have been successfully employed to analyse signals in the time and frequency domains. These methods extract relevant features for further analysis. Considering the limitations of signal processing-based fault event approaches, this study proposes a PQD identification method utilizing the S-transform. The selection of appropriate features remains difficult, necessitating developments in statistical evaluation and machine learning techniques [17]. Following the feature engineering (FE) phase, the feature selection (FS) procedure is used to select a reduced number of the best features that have a strong relationship with the output classes. Because of how features work and how they relate to each other, FS is seen as an extra step that comes before classification. It requires putting together a feature vector with the most important features based on how they relate to the output classes.

Through the use of the Hilbert–Huang transform (HHT) and the weighted bidirectional-extreme learning machine (WBELM), Sahani and Dash presented a real-time method for detecting and classifying PQDs. Online power quality monitoring systems benefited greatly from their method, which beats competing classifiers [25]. Using sparse signal decomposition (SSD) on an overcomplete hybrid dictionary (HD) matrix, Manikandan et al. suggested a new method for detecting and classifying PQDs. The method is well suited for PQ monitoring networks as it captures morphological details and extracts PQ features for categorization [26]. Another approach [27] utilizes a quick time-time transform and a residual-extreme learning machine to detect and classify power quality issues in wind-grid integrated systems. This method optimizes computational speed and demonstrates accuracy even in the presence of noisy signals. Thirumala et al. suggested an automatic recognition technique that combines adaptive filtering with a multiclass support vector machine. When dealing with PQDs singly or in tandem, their strategy proved effective, resilient, and accurate [21]. Hole and Naik analysed PQ signals based on IEEE 1159-2009 standards, employing mathematical parametric models and the discrete wavelet transform (DWT). Machine learning algorithms such as k-nearest neighbors (KNN) and Naive Bayes (NB) were used for signal classification [28]. Markovska et al. implemented a real-time PQ event classifier that could classify 21 types of single and combination PQDs, even when they occurred simultaneously. Implementing a zero-crossing detector, an efficient feature extraction algorithm, and an optimized, noise-resistant classification were the research goals. The paper also described a LabVIEW-based RF classification technique and a zero-crossing detection software solution. They found that the classifier was accurate even with considerable white Gaussian noise. Classifier processing satisfied real-time needs. It was validated through experiments generating disturbed voltage signals and comparing them to actual power grid measurements. This real-time classifier has potential applications in developing distributed systems for acquiring, transferring, monitoring, and analysing PQ data in power grids [29]. Saxena et al. utilized support vector machines (SVMs) for feature extraction in power quality event classification. They achieved high accuracy by tuning SVM parameters using the augmented crowd search algorithm (ACSA) and constructing three SVM models after selecting relevant characteristics using the principal component analysis (PCA). Statistical analysis allows for a comparison of the results with those of other methods. Combining SVM with both signal-processing methods yields promising outcomes [30]. Most research on PQD classification relies on machine learning models with manually extracted features from real or simulated signals. Turovic et al. introduced a deep learning approach for directly classifying voltage sag types from three-phase voltage data. Two datasets are generated for model training and validation. This [31] model employs a recurrent neural network, specifically the LSTM architecture, featuring three LSTM layers, two 1D convolutional layers between LSTM pairs, two fully connected layers, and a final softmax layer. The model demonstrates an impressive accuracy of over 92% on the validation dataset. However, when applied to real-world data, it exhibits slightly reduced performance due to various factors, including the presence of harmonics, complex voltage sag combinations, and differences in sampling frequencies between real and artificial datasets. In [32], the authors introduce an innovative end-to-end approach that eliminates manual feature extraction. Instead, it generates synthetic voltage signals using mathematical formulas for voltage sags. A configurable voltage sag generator creates training and validation datasets from these signals. Multiple end-to-end LSTM classifiers are trained using this synthetic data to classify voltage sags based on ABC classification. The top-performing model achieved an impressive accuracy rate of over 90% on real-world data. This approach streamlines research by automating feature extraction and could benefit from standardised synthetic datasets. Table 1 provides an overview of recent publications focusing on the detection and classification of PQDs.

1.2. Contribution and Organization

This research introduces an algorithm for accurately classifying power quality disturbances based on the parameters defined in IEEE Standard 1159-2019. The algorithm successfully classifies both single and multiple PQDs. The PQD signals were generated and exported using MATLAB, while the subsequent analysis was conducted in Python.

The key contributions of this study are as follows:(1)MATLAB was used to simulate and generate PQD signals, including the corresponding disturbances, providing essential samples for the research.(2)The S-transform was employed to extract features from the PQ signals, utilizing the Stockwell Library in Python to perform the Stockwell transform.(3)After extracting the feature vector, it was employed in conjunction with various classifiers such as KNN, SVM, DT, and RF to classify seventeen distinct PQDs. The sklearn library, which offers a range of machine learning tools in Python, was utilized for this purpose.

The remaining sections of this work are organized as follows: Section 2 presents the details of the PQDs considered in this study, providing a comprehensive understanding of their characteristics. Section 3 describes the principle of S-transform (ST) feature extraction and outlines the approach for classifying PQDs using the extracted features. In Section 4, the results are presented and a comparative performance analysis is conducted to evaluate the effectiveness of the proposed method. Section 5 concludes the work by discussing the significant findings obtained from the study and highlighting potential future directions for further research and development in the field of PQD detection and classification.

2. Power Quality Disturbances

There are a total of 17 distinct types of PQD signals taken into account in this investigation. All PQDs for which synthetic equation data are available are included in Table 2.

3. Proposed Methodology

Power quality disturbance signals are known for their nonstationary nature, as their spectral characteristics change over time. The ability to accurately describe and classify the type of PQD present in a given nonstationary signal relies on the extraction of suitable features. In the proposed methodology, the detection of PQDs within nonstationary signals is accomplished through the utilization of the S-transform. Subsequently, classification of the detected disturbances is performed using a random forest (RF) classifier. The S-transform is a powerful tool that captures the time-frequency information of signals and overcomes the limitations of fixed-width windows and complex window function selection encountered by other methods. By applying the ST to the nonstationary PQ signals, important features that characterize the different types of disturbances can be extracted. These features provide valuable insights into the underlying characteristics of the PQDs and serve as discriminative factors for subsequent classification. To classify the detected disturbances, a random forest classifier is employed. The RF classifier is a popular ensemble learning algorithm that combines multiple decision trees to achieve robust and accurate classification. It leverages the collective decision-making capabilities of individual trees to make predictions based on the extracted features from the PQD signals. The RF classifier excels at handling complex and high-dimensional datasets, making it well suited for the classification of PQDs. By combining the ST for detection and the RF classifier for classification, the proposed framework offers a comprehensive approach for PQD analysis. It enables the identification and characterization of different types of PQDs in nonstationary signals, providing valuable insights for further analysis and mitigation strategies in power systems.

3.1. Theory of Stockwell Transform

In 1996, Stockwell came up with the Stockwell transform (ST) method, which lets signs that change over time be looked at in more than one way. Unlike other methods, ST’s output does not change when the input data are noisy [14]. Because of this, ST is the best way to get local phase information and a resolution in the time-frequency domain that changes with frequency. ST uses a set relative bandwidth for multiresolution analysis to filter signals. Continuous wavelet transform (CWT) uses a mother wavelet that stays the same, while ST uses a mother wavelet that changes to figure out the local phase.

The CWT for a signal x (t) is defined by the following equation:where τ is the wavelet position and d is the scale parameter. The S-transform of x (t) is a CWT multiplied by the phase factor.

In the ST, the mother wavelet (window function) is picked based on the frequency content of the signal instead of scale d, which is how it is done in the CWT. This is stated to bewhere represents Gaussian window width.

From equations (2) and (3) for , the ST can be rewritten as

Using the Fourier transform, we can mathematically define the s-transform as

The discrete form of the S-transform can be obtained by combining the fast Fourier transform (FFT) with the convolution theorem.

Discrete S-transform: Setting T as the sample interval results in the discrete PQ signal rather than the continuous . The discrete Fourier transform (DFT) of the sampled signals, for K = 0 to , is shown in the following equation:where n = 1, 2, ……, . By using DFT and the IDFT, the ST of a discrete-time series for can be written aswhere .

The amplitude of the S-transform can be expressed as equation (8) and the phase as equation (9):

3.2. Feature Extraction

The outcome of ST is a 2D complex matrix, which gave valuable time-frequency data from which PQD features were retrieved by calculating several statistics. The features used and the number of features are important parts of making the classifier more accurate and faster. The nine features (k1–k9) extracted in this work included the newly developed disturbance energy ratio (DER) index and other basic statistical measures such as maximum, minimum, average value, standard deviation, variance, skewness, and kurtosis and more specific ones such as RMS value and DER (disturbance energy ratio). The equations shown in Table 3 were used to derive these features. From the matrix created by performing the S-transform, all values were determined and expressed as absolute values. M and N specified the rows and columns, respectively, of the matrix. In this work, by utilizing ST, a total of nine features are extracted from the PQDs depicted in Table 3.

3.3. Random Forest Classifier

Random forest can be applied to classification and regression. It employs numerous decision trees to form a “forest” of trees. To make more accurate predictions than any single tree, this approach combines the knowledge of several weak learners (decision trees). In a random forest method, every decision tree employs an arbitrary subset of training data and an arbitrary combination of characteristics at each node. Random forest most significant characteristics are bootstrap resampling, random feature selection, and out-of-bag error estimation. Many trees are grown by repeating this technique. Each tree in the forest makes a guess during the prediction phase, and the ultimate prediction is reached by averaging all of the trees’ predictions, sometimes through some sort of voting procedure [33]. Assume there are X input data points with being an m-dimensional vector. This information is sent to a group of C trees, whose names are denoted by . The group of trees then predicts that the output will be a value Y. After all the trees have made their predictions, an average is calculated to be used as the final forecast.

Here are the hyperparameters for a random forest classifier:(i)n_estimators: the forest contains 100 trees(ii)criterion: “gini” is the function used to measure the quality of a split(iii)min_samples_split: an internal node can only be split if it has at least 2 samples(iv)min_samples_leaf: a leaf node must have at least 1 sample(v)min_weight_fraction_leaf: a leaf node must have a minimum weighted fraction of the sum total of weights, which is set to 0 by default

3.4. Performance Analysis

Various performance metrics are essential for evaluating classification models and assessing the effectiveness of their predictions. One commonly used metric is the confusion matrix, which provides a correlation between the true labels and the model’s predictions. In the confusion matrix, each row represents the projected instances of a particular class, while each column represents the actual instances of that class. It serves as a foundation for deriving other performance statistics. While the confusion matrix itself is not a performance statistic, it serves as a crucial starting point for calculating various metrics. In Table 4, an example of a confusion matrix for a binary classification problem is presented. These metrics enable us to assess the classification model’s performance from different angles and determine its accuracy, precision, recall, and other relevant measures. By utilizing these performance metrics, we gain valuable insights into the model’s classification capabilities and its ability to correctly predict the classes of interest.

The confusion matrix used in this evaluation provides valuable insights into the performance of the classifier. It comprises four evaluation factors: true positive (TP), true negative (TN), false positive (FP), and false negative (FN). These factors are depicted in each cell of the confusion matrix. The accuracy of the classifier, which serves as an overall measure of its performance, is calculated using the following equation and is presented as a result of this evaluation:

3.4.1. Precision

Precision is the ratio of true positives to the total number of positives that were predicted:

3.4.2. Recall

The percentage of true positives to all positives in the ground truth is called the recall:

3.4.3. F1-Score

The F1-score metric takes both precision and recall into account. The F1-score is calculated using the harmonic mean of equations (11) and (12). The equation is as follows:

4. Results and Discussion

4.1. Dataset Preparation

The authors synthetically generate PQDs using MATLAB 2017 and IEEE 1159. This study examines sampling frequencies of 3.2 kHz and a signal-to-noise ratio (SNR) of 40DB. Table 5 presents the seventeen different types of PQDs (C1–C17) considered in the research. The authors produce a total of 20,000 instances of these classes. To perform PQD classification, a dataset containing disturbance details is necessary. The authors generated this dataset by randomly simulating and generating signals with abnormalities. Figure 1 depicts the ST contour of PQD signals, demonstrating that distortion in the ST contour occurs whenever a disturbance happens.

4.2. Results of Classifier

The results of the classification are shown as a confusion matrix with 17 × 17 cells. Elements on the diagonal indicate correctly classified PQDs, while those off the diagonal indicate incorrectly categorized PQDs. The KNN confusion matrix in Table 6 clearly illustrates the significant number of misclassifications that have occurred. It is concerning that 27 sag signals have been incorrectly classified, with 12 being identified as interruptions, 3 as flickers, 1 as interruptions with harmonics, and 11 as sags with flickers. Similarly, 7 swell signals have been mistakenly categorized as 6 flickers and 1 as swell with flicker, while 23 interruption signals have been misidentified as 11 sags, 2 flickers, 1 interruption with harmonics, and 9 flickers with interruptions. The misclassification of 44 harmonic signals as 5 sags with harmonics, 9 flickers with harmonics, and 30 notches with harmonics is also a cause for concern. In addition, 14 flicker signals have been mistakenly categorized as 1 sag, 1 swell, 11 sags with flickers, and 1 swell with flicker, while 35 oscillatory transient signals have been misidentified as 4 harmonics, 7 swells with harmonics, and 14 oscillatory transients with harmonics. The misclassification of 29 notch signals as 16 interruptions with harmonics and 13 sags with flickers is also alarming. Furthermore, 19 sags with harmonic signals have been misclassified as 3 sags, 1 interruption, and 15 interruptions with harmonics, while 32 swell with harmonic signals have been mistakenly categorized as 6 swells and 26 oscillatory transients. The misclassification of 14 interruptions with harmonics signals as 1 sag, 1 interruption, 10 sags with harmonics, and 2 flickers with harmonics is also a cause of concern. Moreover, 36 flickers with harmonics signals have been mistakenly categorized as 36 notches, and 18 oscillatory transients with harmonics have been incorrectly categorized as 1 flicker, 5 oscillatory transients, and 12 flickers with harmonics. There is a misclassification of 22 notches with harmonics as 11 harmonics and 11 notches.

Finally, 42 sags with flickers have been misclassified as 3 sags, 8 harmonics, 3 swells with harmonics, 10 interruptions with harmonics, 9 swells with flickers, and 9 interruptions with flickers. In addition, 10 swells with flickers have been misidentified as swell with harmonics, and 17 interruptions with flickers have been incorrectly categorized as 5 sags, 6 interruptions, and 6 flickers.

Table 7 presents the confusion matrix produced by the SVM; from this, it can be inferred that a total of 16 sag signals, including 6 interruptions, 1 sag with harmonics, and 9 sags with flickers, have been incorrectly categorized. 13 interruptions have been misidentified as 10 sags and 3 interruptions with harmonics. 24 harmonics are mistakenly categorized as 2 sags with harmonics and 22 flickers with harmonics. 7 flickers are incorrectly categorized as 2 sags and 5 sags with flickers. 15 oscillatory transients have been misidentified as 10 swells with harmonics and 5 oscillatory transients with harmonics. 30 sags with harmonics are incorrectly categorized as 4 harmonics, 23 interruptions with harmonics, and 3 flickers with harmonics. 10 swells with harmonics signals are misidentified as notches with harmonics. 34 interruptions with harmonics are incorrectly categorized as 31 sags, 1 interruption, 1 flicker with harmonics, and 1 interruption with flickers. 28 flickers with harmonics are mistakenly categorized as 5 sags, 6 harmonics, 4 oscillatory transients, and 13 oscillatory transients with harmonics. 22 oscillatory transients with harmonics are misclassified as 7 sags with harmonics and 15 notches with harmonics. 56 notches with harmonics signals are mistakenly categorized as 35 sags with harmonics and 21 sags with flickers. 45 sags with flickers have been misidentified as 19 swells with harmonics and 26 interruptions with harmonics. 8 interruptions with flicker have been misidentified as 1 flicker and 7 interruptions with harmonics.

Table 8 presents the confusion matrix for DT, which reveals that 7 sags are incorrectly categorized as 3 interruptions and 4 sags with flickers. There is misclassification of 24 harmonics as 13 flickers with harmonics and 10 notches with harmonics. 11 flickers are incorrectly categorized as 4 sags, 1 swell, and 6 sags with flickers. There is a misclassification of 15 sags with harmonics as 7 interruptions with harmonics and 8 flickers with harmonics. 4 swells with harmonics are mistakenly categorized as 4 flickers. 7 interruptions with harmonics are incorrectly categorized as 7 sags with harmonics. 10 flickers with harmonics are wrongly categorized as 2 flickers and 8 interruptions with harmonics. 4 oscillatory transients with harmonics are wrongly categorized as 4 sags with flickers. There has been a misidentification of 7 notches with harmonics as 7 sags with harmonics. 7 sags with flickers are incorrectly categorized as 7 harmonics. 2 interruptions with flickers are wrongly categorized as 1 flicker and 1 notch with harmonics.

The RF confusion matrix is represented in Table 9; from this, we observe that 7 of the harmonic signals are incorrectly categorized as flickers with harmonics. 15 sags with harmonic signals are misclassified as 1 harmonics, 11 interruptions with harmonics, and 3 flickers with harmonics. There are 8 cases of incorrect classification of interruption with harmonic signals as sags with harmonics. 17 flickers with harmonic signals are misclassified as 7 harmonics and 10 interruptions with flickers. 7 sags with flicker signals are misclassified as 5 harmonics and 2 interruptions with harmonics. Figures 2(a)2(c) depict the performance metrics of RF, including precision, recall, and F-score, respectively.

4.3. Overall Comparison (RF vs. DT vs. SVM vs. KNN)

Table 10 summarises the performance of all the algorithms employed in this work. In order to validate the effectiveness of the RF algorithm compared to other ML algorithms, a comparison has been done through a line graph, as shown in Figures 3(a)3(c). When there is no disturbance, the precision, recall, and F-score values are almost as close to 1.00 as all the algorithms allow.

During swell, we can observe all performance metrics values as 0.98 with the KNN algorithm, whereas the rest retains the same value of 1.00. The RF algorithm gives performance metrics a value of 1.00 during sag, but other algorithms give a value between 0.86 and 0.99. RF algorithm achieves a precision value of 1.00 during interruption, whereas KNN, SVM, and DT have precision values of 0.94, 0.98, and 0.99, respectively. However, the recall and F-score values for all algorithms ranged from 0.89 to 0.98, with none of them achieving a value of 1.00. During harmonics, we observed varying performance metrics with all four algorithms. The precision values ranged from 0.90 to 0.97, and none of them reached 1.00. The RF algorithm performed better in terms of recall and F-score, with values of 0.98 and 0.99, respectively. KNN, SVM, and DT gave recall values of 0.87, 0.93, and 0.93, respectively. The F-score of KNN and SVM was 0.89, whereas DT had F-scores of 0.95. In the case of flicker, RF showed high performance with an F-score of 1.0, while KNN and SVM had lower F-scores of 0.95 and 0.99, respectively. The recall values for DT, KNN, and SVM were 0.97, 0.96, and 0.98, respectively.

During the oscillatory transient, RF and DT achieved a perfect F-score of 1.0, while KNN and SVM had lower values. In the case of a notch with harmonics, KNN had the lowest performance metric values compared to the other algorithms, while RF, DT, and SVM had perfect values of 1.0. For sag with harmonics, RF had the highest precision value of 0.98, while SVM, KNN, and DT had values of 0.88, 0.96, and 0.96, respectively. The recall values for the same algorithms were 0.95, 0.92, 0.96, and 0.98, respectively. The F-score values were 0.9, 0.95, 0.96, and 1.0, respectively. Except for KNN and SVM, all other algorithms achieved a precision of 1.00 during swell with harmonics, with KNN and SVM obtaining 0.90 and 0.91, respectively. In terms of recall, RF achieved a value of 1.00, while KNN, SVM, and DT obtained 0.9, 0.97, and 0.99, respectively. The RF algorithm had an F-score of 1.00, but KNN, SVM, and DT had F-scores of 0.89, 0.94, and 0.99, respectively. During flicker with harmonic performance of all the ML algorithms with precision of 0.99, where RF produces 0.97. The RF, DT, and KNN all have 0.96 and 0.95, respectively, and the SVM gives 0.9. During oscillatory transients with harmonics, RF performed similarly, with a performance metric value of 1. DT, KNN, and SVM had precision values of 1.0, 0.96, and 0.95, respectively; recall values of 0.99, 0.95, and 0.94, respectively; and F-score values of 0.99, 0.95, and 0.94, respectively. During the notch with harmonics, precision, and recall, the F-score value with the SVM algorithm is noted as 0.94, 0.85, and 0.89, whereas KNN gives 0.92, 0.94, and 0.93. At the same time, RF gives 1.00, while DT moderately performs with precision, recall, and an F-score value of 0.97, 0.98, and 0.97. During sag with flicker, RF achieved a precision value of 1.0, while KNN, SVM, and DT had values of 0.9, 0.91, and 0.96, respectively. The recall values were 0.98, 0.95, 0.87, and 0.88 for RF, DT, SVM, and KNN, respectively. The F-score values were 0.99, 0.95, 0.89, and 0.89 for RF, DT, SVM, and KNN, respectively. All algorithms achieved a performance value of 1.00 during swell with flicker. However, KNN had a precision value of 0.94, a recall value of 0.98, and an F-score value of 0.96. During the interruption with flicker, RF algorithms achieved a higher recall value of 1.00, while KNN, SVM, and DT had recalls of 0.96, 0.98, and 0.99, respectively. The KNN and DT had F-scores of 0.95 and 0.99, respectively, whereas SVM and RF had the same F-score value of 0.98.

Table 11 shows that the random forest (RF) method is better than k-nearest neighbor (KNN), support vector machine (SVM), and decision tree (DT). The RF method improves accuracy, precision, recall, and F-score, which are important measures of a model’s ability to classify data and make accurate predictions. In summary, these results suggest that the RF technique is a more successful classification algorithm than the KNN, SVM, and DT methods. The RF approach may be utilized by researchers and practitioners to develop accurate and dependable classification models.

4.4. Comparison with Other Methods

In this study, the proposed approach is evaluated and compared with recent studies and methods for determining and classifying power quality disturbances. The evaluation takes into account factors such as the number of signals analysed, sample rates, and accuracy achieved. The results clearly demonstrate that the proposed ST + DT method outperforms other contemporary approaches, achieving a classification accuracy of 98.02 percent. By utilizing the S-transform for feature extraction, the proposed method overcomes limitations associated with fixed-width windows and challenging window function selection thanks to the extended capabilities of the S-transform which combine wavelet and Fourier transforms. Table 12 presents a comparative analysis of the effectiveness of the proposed ST + DT method against the findings of several recent studies conducted between 2015 and 2022. The accuracy of the sparse signal decomposition (SSD) with a hybrid dictionary (HD) approach is reported as 95.4 percent for classifying seven PQD classes. In 2018, Saini and Beniwal proposed an FFT + ELM classifier with 95.38 percent accuracy for classifying 12 PQDs. Sahani and Dash introduced a classifier based on HHT and WBELM, achieving 95.6 percent accuracy for 16 PQD classes. Thirumala et al. presented a PQD classifier based on EWT and SVM, achieving a classification accuracy of 95.56 percent for 16 distinct PQD classes. Hole, S.D., and Naik employed mathematical parametric models and the discrete wavelet transform (DWT) in 2020, achieving a precision of 95.83 percent using k-nearest neighbors (KNN) and Naive Bayes (NB) classification algorithms for six PQD classes. The WT + PCA + SVM classifier proposed by Saxena et al. demonstrated an accuracy rate of 96.2 percent for identifying five distinct forms of PQDs. In 2020, Markovska et al. implemented the PQD classifier based on random forest (RF) and DWT, achieving a classification accuracy of 96.48% for 21 PQD classes. The comparative results unequivocally indicate the superior performance of the proposed method.

Overall, the results demonstrate the high efficiency and superiority of the suggested method compared to existing approaches for power quality disturbance detection and classification.

5. Conclusion

This research provides a novel approach based on the Stockwell transform (ST) and a random forest classifier for efficient recognition of PQD signals. Firstly, the S-transform technique is used to extract the feature dataset from the produced PQD signals. Sampling frequencies of 3.2 kHz and a signal-to-noise ratio (SNR) of 40 dB are investigated. Seventeen (C1–C17) varieties of distinct PQDs are considered. The extracted dataset is then trained and evaluated using the suggested random forest method. The following is a summary of the most important outcome of the output classification: (i) it is determined that the overall detection accuracy is 99.01% and (ii) the proposed ST + RF classification method outperforms various recent PQD classification methods, including KNN, SVM, and DT, with an overall accuracy of 93.41% for KNN, 94.83% for SVM, and 98.09% for DT. The current work can be expanded in the accompanying directions: (i) evaluating the suggested strategy with regard to real-time PQDs’ information, (ii) incorporating additional disorders into the methodology in an attempt to classify more types of disorders, and (iii) implementing and examining deep learning techniques for PQDs’ identification in a more complicated scenario.

Nomenclature

AI:Artificial intelligence
DAG:Directed acyclic graph
DG:Distributed generation
DRST:Double resolution S-transform
DT:Decision tree
EEMD:Ensemble empirical mode decomposition
EMD:Empirical mode decomposition
EWT:Empirical wavelet transform
FFT:Fast Fourier transform
FRFT:Fractional Fourier transform
FST:Fast S-transform
FT:Fourier transform
GT:Gabor transform
HHT:Hilbert–Huang transform
HMM:Hidden Markov model
HT:Hilbert transform
IEWT:Improved empirical wavelet transform
IGWO:Improved grey wolf optimization
IMFs:Intrinsic mode functions
KELM:Kernel extreme learning machine
KF:Kalman filter
KNN:K-nearest neighbor
MM:Mathematical morphology
PQ:Power quality
PQDs:Power quality disturbances
RES:Renewable energy sources
RF:Random forest
RKELM:Reduced kernel extreme learning machine
SD:Standard deviation
SGBT:Sparse group-based tree
SOFC:Solid oxide fuel cell
ST:S-transform
STF:Strong tracking filter
STFT:Short-time Fourier transform
SVM:Support vector machine
THD:Total harmonic distortion
VMD:Variational mode decomposition
WBELM:Weighted bidirectional-extreme learning machine
WGO:Wild goat optimization
WPT:Wavelet packet transform
WT:Wavelet transform.

Data Availability

No data were used to support the findings of this study.

Conflicts of Interest

The authors declare that they have no conflicts of interest.