Full text
Advanced Ensemble Learning Framework for Reliable Smart Grid Stability detection Saliha Mezzoudj1, Yasmina Saadna2, and Meriem Khelifa3 1Department of Computer Science, University of Algiers, Algiers, Algeria , [email protected] 2Labstic laboratory, Batna 2 University, Batna, Algeria , [email protected] 3Artificial Intelligence of Information Technologies, Department of Computer Science and Information Technologies, University of Kasdi Merbah Ouargla, Algeria , [email protected] Abstract The increasing complexity of smart grid systems necessitates advanced methodologies to ensure reliable stability classification and seamless power delivery across consumer domains. This study introduces an innovative ensemble learning framework designed to classify smart grid stability using the Smart Grid Stability Augmented dataset. The proposed framework integrates multiple ensemble techniques, including Bagging, AdaBoost, Stacking, and Voting Classifiers, to improve robustness, accuracy, and reliability. A 5-fold cross-validation strategy is implemented to minimize overfitting and validate model performance. The dataset undergoes preprocessing with feature standardization and binary encoding of the target variable to ensure uniform contributions from all features. Experimental results indicate that the soft Voting Classifier, which is a combination of single machine learning models logistic regression, support vector machine, and random forest (LR+SVC+RF), outperforms other models by achieving a peak accuracy of 97.3%, demonstrating exceptional stability classification performance. Compared to individual machine learning models and existing state-ofthe-art approaches, the proposed ensemble framework exhibits superior performance across multiple evaluation metrics. These results underscore the potential of ensemble learning in enhancing smart grid stability, contributing to more reliable and efficient power grid management systems. Keywords: Grid Stability, Ensemble Learning, Bagging, AdaBoost, Soft Voting, stacking, CrossValidation 1 Introduction The smart grid is an advanced concept aimed at transforming the future electricity network by enhancing its flexibility, adaptability, and autonomous management [20], [16]. This complex system incorporates various interconnected subsystems [16], integrating diverse disciplines and enabling the autonomous operation and control of its parts. It is geographically spread out and consists of a wide range of components. Additionally, the smart grid demonstrates emerging behaviors and continuous development. As a key element in a global network of linked systems, it encourages collaboration to promote the development of innovative services across different sectors. The primary factors propelling advancements in this field are energy efficiency and optimized resource management at both local and global levels, requiring comprehensive monitoring and control [12]. As electricity demand rises with population growth, the dependence on natural resources for power generation increases. Nevertheless, this process remains intricate and expensive. Significant research has been directed towards enhancing grid networks to improve power distribution efficiency. The smart grid offers a promising solution by leveraging Information and Communication Technology (ICT) to gather data on consumer behavior, thereby enabling the creation of context-aware systems that optimize power distribution efficiency [10]. Traditional stability analysis and control methods have proven insufficient for managing the complexities of modern smart grids. In response, recent advances in artificial intelligence (AI) provide effective tools to meet the high demands of security and stability in these systems [14]. The development of an intelligent grid that can accurately predict power demand is essential. This can be achieved through the application of Machine Learning (ML) algorithms [3], [6] to analyze the large amounts of data generated by the grid. These advancements in smart grid technology are crucial for reducing environmental pollution and lowering electricity costs, promoting a more cost-effective and sustainable energy system. Recent developments in artificial intelligence (AI) and machine learning (ML) have significantly enhanced 29
the prediction and management of smart grid stability and energy systems. Oqaibi and Bedi (2024) introduced a hybrid forecasting system that integrates data deconstruction and attention mechanisms, achieving a prediction accuracy of 90.45% on the Kaggle dataset. Their work emphasizes the need for optimizing hybrid models to reduce computational complexity and improve prediction efficiency [15]. Xu et al. (2024) proposed a time-series depthwise separable convolutional neural network (CNN) with an attention mechanism, reaching 88.9% accuracy using the UCI dataset. Their study underscores the importance of large datasets for effectively training deep learning models [8]. Further contributions include Mohsen (2023), who developed an efficient artificial neural network (ANN) model for Decentralized Smart Grid Control (DSGC) systems, achieving a testing accuracy of 97.36% and a perfect AUC score of 100% through hyperparameter tuning [18]. Similarly, Alsirhani (2023) combined Multi-Layer Perceptron and Extreme Learning Machine (MLP-ELM) with Principal Component Analysis (PCA), attaining 95.8% accuracy, which highlights its potential for improving grid reliability amid fluctuating energy demands and growing renewable integration [1]. Javaid (2022) proposed a novel stacking ensemble model, MLBCSM, which combines multiple boosting classifiers (AdaBoost, XGBoost, HistBoost, CatBoost, LGBoost) with an Adaptive Synthetic Sampling Technique (ADASYN) to address data imbalance. The model, which includes data preprocessing, balancing, and classification, outperformed traditional methods, achieving 92.39% accuracy and 93.22% recall. These results demonstrate its effectiveness in detecting the stability in smart grids [14]. In this work, a novel ensemble-based machine learning approach is proposed to predict the stability of smart grids by classifying the Smart Grid Stability Augmented Dataset. The experimental results are compared with recent machine learning algorithms, including individual classifiers such as KNN, NB, Support Vector Classifiers, as well as ensemble methods like Bagging, AdaBoost, Stacking, and soft Voting Classifiers. The main steps involved in our contribution: 1. The Smart Grid Stability Augmented Dataset is loaded, and stability labels are mapped to binary values. The dataset is shuffled, and features are standardized to facilitate model convergence. 2. Four ensemble learning models Bagging, AdaBoost, Stacking, and Voting Classifiers are defined. These models utilise a variety of base learners, including Decision Trees, Logistic Regression, Random Forest, and Support Vector Classifier, to enhance predictive accuracy. 3. A 5-fold cross-validation strategy is employed to evaluate model performance, ensuring robust estimates of model effectiveness and mitigating overfitting risks. 4. Quantitative comparison of the models’ performance is provided. The voting achieves the highest accuracy and AUC, while Stacking Classifier excels in integrating multiple models. AdaBoost and Bagging show strong performance in balancing precision and recall, and the Voting Classifier provides competitive results across all metrics. with voting method reaching an accuracy of 97.3%, demonstrating superior predictive capability compared to individual models and other state-of-the-art models. The rest of the paper is organized as follows. Section II discusses recent state-of-the-art literature related to the application of deep learning algorithms on smart grids. In Section III,the proposed model is discussed in detail. Experimental results are discussed in Section IV, which is followed by a conclusion and future work in Section V. 2 Proposed approach A variety of machine learning algorithms can be applied to the problem of stability detection, with their effectiveness typically evaluated using metrics such as accuracy and false positive rates. To improve prediction performance and reduce false positives, researchers have proposed numerous ensemble learning methods. Ensemble learning techniques combines multiple machine learning algorithms to achieve enhanced predictive performance compared to standalone models [13]. Broadly, ensemble learning is categorized into two types: parallel and sequential [17] Parallel methods, such as bagging and random forests, train independent base classifiers to promote diversity, whereas sequential methods, including boosting, iteratively refine weak learners to improve accuracy. Ensemble methods are particularly robust and adaptable, excelling in scenarios involving noisy or complex data. This study introduces an ensemble learning framework to classify the stability of smart grid systems using the Smart Grid Stability Augmented dataset. The methodology incorporates various ensemble techniques to enhance the robustness, accuracy, and reliability of stability predictions. In this section, we describe the architecture 30
of our system as shown in Figure 1. Figure 1: Architecture of the proposed system The approach is structured as follows: 2.1 DATA PREPROCESSING Pre-processing is a critical step in improving data quality and enhancing the performance of machine learning (ML) models. The Smart Grid Stability Augmented dataset includes features related to grid stability and a target label (stabf) that indicates stability (stable or unstable). The variability in feature ranges within the dataset can lead to biases, as features with higher magnitudes may dominate during model training. To address this, StandardScaler is employed for data normalization, ensuring all features contribute equally. This technique transforms the data into a common scale, thereby enhancing classifier performance. The categorical target variable is mapped to binary values, where: 0: : represents an unstable state and 1: indicates stability. Non-numeric values in the dataset are converted to numeric format using encoding techniques to make the data suitable for ML algorithms. Additionally, the dataset is shuffled to mitigate any ordering bias, further ensuring the robustness and reliability of the training process. 2.2 CROSS VALIDATION To enhance model reliability and generalization, a 5-fold cross-validation strategy is employed. The dataset is divided into five equal parts, where each part is used as a validation set once, while the remaining four are used for training. This approach minimizes overfitting and ensures. 2.3 ENSEMBLE LEARNING METHODS In this part, we explore the ensemble learning paradigm, focusing on its fundamental components, combination techniques for base learners, and methods for selecting ensembles. 2.3.1 Bagging (Bootstrap Aggregating) classifier Bagging, or Bootstrap Aggregating, is an ensemble learning technique designed to reduce model variance and improve predictive accuracy by combining multiple base models [4], [21]. In this approach, each base model is trained on a distinct bootstrapped sample of the dataset, created by random sampling 31
with replacement. For this study, the Decision Tree Classifier is utilized as the base learner, with a total of 50 estimators. Each tree is independently trained on a bootstrapped sample, enabling the model to capture diverse patterns within the data. After training, predictions for unseen data are obtained by aggregating the outputs of all 50 models: •For regression tasks, the final prediction is the average of all individual predictions. •For classification tasks, the final prediction is determined by majority voting among the models. This ensemble strategy significantly reduces the variance of the model compared to a single decision tree, leading to more stable and accurate predictions. The Bagging approach is particularly effective for noisy or complex datasets, such as those encountered in smart grid stability detection. By leveraging multiple models and aggregating their outputs, Bagging enhances the robustness and generalization ability of the framework, making it a reliable choice for high-stakes applications in smart grid systems. 2.3.2 AdaBoost (Adaptive Boosting) Classifier In this study, the AdaBoost algorithm was chosen as the boosting method. Developed by Freund and Schapire [7], AdaBoost is one of the most widely used boosting techniques, offering a strong theoretical foundation and proven efficacy in generating accurate predictions. AdaBoost constructs a strong classifier by combining the weighted outputs of weak classifiers, addressing earlier boosting methods limitations. In our implementation of AdaBoost begins by initializing equal weights for all training samples. In each boosting round, a weak learner (in this case, a Decision Tree Classifier) is trained on the weighted dataset. The classifier’s weighted error is calculated, and its performance is quantified using a weight αt. This weight determines the importance of the weak learner in the final ensemble. Misclassified samples are assigned higher weights, making them more influential in subsequent iterations. The process is repeated for Tboosting rounds, where T= 50 in this implementation. The final prediction is made by combining the outputs of all weak classifiers, weighted by their respective importance values. 2.3.3 Stacking Stacking is an ensemble learning technique that combines predictions from multiple base models (level-0 models) and refines them using a meta-model (level-1 model) [3]. The primary goal is to leverage the strengths of individual models and optimize the final prediction by training an additional layer. In our implementation: •Base Models: Random Forest and Support Vector Classifier are trained independently on the training dataset. Each model generates predictions, capturing unique patterns within the data. •Meta-Model: Logistic Regression is used as a second-level model, which takes the predictions of the base models as input. It learns to combine these predictions optimally, mitigating individual weaknesses. •Workflow: The training process involves generating predictions for the validation set using the base models, constructing a new dataset comprising these predictions, and training the meta-model on this dataset. During inference, the base models generate predictions for unseen data, which are then aggregated by the meta-model to produce the final output. 2.3.4 Voting Classifier Algorithm (Soft Voting) The voting Classifier is an ensemble learning method that combines predictions from multiple base models to improve predictive accuracy and robustness [9]. In the context of this study, Soft Voting is used, which involves averaging the predicted probabilities from each of the base models. The base models utilized in this framework include: •Random Forest •Support Vector Classifier (SVC) •Logistic Regression 32
Algorithm 1 presents the implementation details of the Soft Voting Classifier. This algorithm integrates multiple base models by averaging their predicted class probabilities, ensuring a more robust final prediction. The base models utilized in this study include Random Forest, Support Vector Classifier (SVC), and Logistic Regression. Each model generates probability estimates for each class, and the final prediction is determined by selecting the class with the highest average probability. Algorithm 1 Voting Classifier Algorithm (Soft Voting) 0: Input: 0: Training dataset D={X, y}, where Xdenotes feature vectors and yrepresents class labels. 0: Base Models: Random Forest, Support Vector Classifier, and Logistic Regression. 0: Soft Voting aggregation scheme. 0: Output: Final predicted class labels ˆyfinal. 0: Step 1: Train each base model on the training dataset D. 0: model1←Train Random Forest on D. 0: model2←Train Support Vector Classifier on D. 0: model3←Train Logistic Regression on D. 0: Step 2: For each test instance xtest, obtain probability estimates from each model: 0: p1←Probability prediction from model1for xtest. 0: p2←Probability prediction from model2for xtest. 0: p3←Probability prediction from model3for xtest. 0: Step 3: Compute the average probability for each class: 0: Pavg(ck) = 1 3(p1(ck) + p2(ck) + p3(ck)) for each class ck. 0: Step 4: Assign the class with the highest averaged probability as the final prediction: 0: ˆyfinal = arg maxkPavg(ck), where kdenotes the class label index. =0 3 Results and Discussion This section presents the results from the experiments conducted to assess the performance of the proposed ensemble learning approach for smart grid stability detection, using the Smart Grid Stability Augmented dataset comprising 60,000 samples. The experiments were executed on Google Colab, utilizing an online GPU service, with additional processing on a personal computer running Linux OS and an Intel Core i5 processor. Python 3.7 and libraries such as scikit-learn and pandas were employed for model implementation and evaluation. The dataset, sourced from the UCI Machine Learning Repository [5], consists of 60,000 instances and 14 attributes related to factors influencing smart grid stability. The target variable indicates system stability with binary labels: 0 for unstable and 1 for stable. The performance of the model was evaluated using several metrics. Accuracy was calculated as the ratio of correct predictions (True Positives and True Negatives) to total instances. Precision measured the accuracy of predicted stable instances, while Recall assessed the proportion of actual stable instances correctly identified. The F1 Score, as the harmonic mean of Precision and Recall, provided a balanced measure, and Specificity evaluated the proportion of correctly predicted unstable instances. These metrics collectively evaluate the overall effectiveness of the ensemble learning model for smart grid stability detection. The results presented in Table 1 demonstrate the performance of various ensemble learning models in detecting smart grid stability. The models evaluated include Bagging, AdaBoost, Stacking, and soft Voting classifiers, each exhibiting different strengths in terms of accuracy, precision, recall, F1 score, cross-validation accuracy, and ROC AUC. The Bagging classifier performed well with an accuracy of 91.6%, but lagged behind in precision and recall, suggesting challenges in accurately identifying stable and unstable grid states. AdaBoost showed improved precision and F1 score over Bagging, but still had a lower recall, meaning it missed some stable instances. The Stacking classifier, which combines multiple models, achieved the highest performance with an accuracy of 95.5%, precision of 94.3%, and ROC AUC of 99.3%, demonstrating strong generalization and the ability to discriminate grid stability effectively. The Voting classifier performed the best overall, with an accuracy of 97.3%, precision of 96.6%, and an impressive ROC AUC of 99.7%. This model’s performance was bolstered by combining multiple classifiers in a soft-voting scheme, making it highly robust for smart grid applications. 33
As shown in Figure 2, the Voting and Stacking classifiers emerged as the top performers, offering the best accuracy and ROC AUC scores. These models are particularly suited for real-time smart grid stability detection, where high precision, recall, and robustness are critical. The 5-cross-validation accuracy values for all methods indicate stability in model performance across different subsets of the data, further validating the models’ reliability and generalization. Figure 2: Comparison between ensemble learning methods using 5-cross validation From Figure 3, the analysis of the learning curves reveals a consistent trend of convergence toward high performance across all ensemble methods, showcasing their strong generalization capabilities. The performance for all models indicate that ensemble techniques effectively handle the complexity of the classification task, leading to optimal predictions. Notably, Stacking and Voting models outperform other methods in most metrics, demonstrating their robust ability to combine diverse features for superior results. Bagging and AdaBoost, while slightly behind in some metrics, still deliver highly competitive performances, further reinforcing the effectiveness of ensemble learning in enhancing classification tasks. Table 1: Model Comparison Results Model Accuracy Precision Recall F1 Score ROC AUC Bagging 0.916 0.888 0.879 0.883 0.975 AdaBoost 0.926 0.914 0.878 0.895 0.983 Stacking 0.955 0.943 0.930 0.937 0.993 Voting 0.973 0.966 0.958 0.962 0.997 4 Comparison with Existing Approaches In this study, we evaluated the performance of our proposed ensemble models for smart grid stability detection, comparing them with existing methods based on key metrics such as accuracy, precision, recall, and F1 score as shown in Table 2. Previous techniques like CART (80.0%), XGBoost (97.82%), and stacking ensemble models (92.395%) showed competitive results, with Mohsen et al. (2023) achieving the highest accuracy of 97.36% using an ANN-based MLP model. Our ensemble models demonstrated 34
Figure 3: Learning curves (training and testing) of each model Table 2: Comparison of Our Proposed Approach with Existing Approaches Year Reference Prediction Technique Accuracy (%) Precision Recall F1 Score 2018 Arzamasov et al. [19] CART 80.0 – – – 2019 Chen et al. [11] XGBoost 97.82 – – – 2022 Javaid et al. [14] Stacking ensemble model, MLBCSM 92.395 – 93.222 – 2023 Alsirhani et al. [1] MLP-ELM 95.8 – – – 2023 Mohsen et al. [18] ANN based on MLP 97.36 98.02 98.03 98.02 2024 Alessandro et al. [8] GAN-GRID 90.45 – – – 2024 Single Model (SVM) [2] SVM 81.0 0.869 0.810 0.843 2024 Single Model (KNN) [2] KNN 82.3 0.881 0.823 0.855 2024 Single Model (DT) [2] Decision Tree (DT) 83.4 0.891 0.834 0.866 2024 Single Model (MLP) [2] MLP 84.3 0.897 0.843 0.875 2024 Single Model (RF) [2] Random Forest (RF) 87.4 0.917 0.874 0.900 2025 Our Model (Bagging) Bagging 91.6 0.888 0.879 0.883 2025 Our Model (AdaBoost) AdaBoost 92.6 0.914 0.878 0.895 2025 Our Model (Stacking) Stacking 95.5 0.943 0.930 0.937 2025 Our Model (Soft Voting) Soft Voting 97.3 0.966 0.958 0.962 35
significant improvements. The Bagging model achieved 91.6% accuracy, AdaBoost improved to 92.6%, and Stacking reached 95.5%. The Voting classifier outperformed all, with 97.3% accuracy and impressive precision (0.966), recall (0.958), and F1 score (0.962). These results highlight the effectiveness of ensemble learning in enhancing smart grid stability detection, with advanced methods like Stacking and Voting delivering superior accuracy and balanced performance, showcasing the power of combining diverse models for optimal stability detection in smart grid applications. 5 Conclusion In this study, we have proposed an ensemble learning framework for smart grid stability detection, leveraging techniques such as Bagging, AdaBoost, Stacking, and soft Voting Classifiers. These methods were evaluated on the Smart Grid Stability Augmented dataset, demonstrating their robustness, accuracy, and reliability in predicting grid stability. Experimental results showed that while simpler models such as Bagging and AdaBoost provide competitive results, more advanced ensemble methods, including Stacking and soft Voting, significantly outperform them, offering higher accuracy, precision, recall, and F1 scores. In particular, the Voting classifier achieved the best overall performance, showcasing the benefits of combining multiple strong classifiers to improve prediction reliability. The results indicate that ensemble learning techniques are well-suited for smart grid stability detection, providing a reliable and scalable solution for ensuring grid stability in real-world applications. Future research could focus on enhancing the proposed framework by integrating it with real-time data from smart grid systems to assess its adaptability in dynamic and evolving environments. Furthermore, exploring the use of deep learning models and hybrid ensemble techniques may offer additional performance improvements. Investigating the incorporation of feature selection or dimensionality reduction methods could also enhance model efficiency and computational scalability. References [1] A. Abukwaik A. I. Taloba R. M. Abd El-Aziz A. Alsirhani, M. M. Alshahrani and M. Salem. A novel approach to predicting the stability of the smart grid utilizing mlp-elm technique. Alexandria Engineering Journal, 74:495–508, 2023. [2] B. Prabadevi N. Deepa W. S. Alnumay T. R. Gadekallu A. K. Bashir, S. Khan and P. K. R. Maddikunta. Comparative analysis of machine learning algorithms for prediction of smart grid stability. International Transactions on Electrical Energy Systems, 31(9):e12706, 2021. [3] B. K. Bose. Artificial intelligence techniques in smart grid and renewable energy systems—some example applications. In Proceedings of the IEEE, volume 105, pages 2262–2273, Nov. 2017. [4] L. Breiman. Bagging predictors. Machine Learning, 24(2):123–140, 1996. [5] D. Dua and C. Graff. Uci machine learning repository: Smart grid stability augmented dataset. Online, 2019. [6] F. Un-Noor S. S. Sikander E. Hossain, I. Khan and M. S. H. Sunny. Application of big data and machine learning in smart grid, and associated security concerns: A review. IEEE Access, 7:13960– 13988, Jan. 2019. [7] Y. Freund and R. E. Schapire. A decision-theoretic generalization of online learning and an application to boosting. 1995. [8] X. Liang-et al. H. Xu, F. Hu. A framework for electricity load forecasting based on attention mechanism time series depthwise separable convolutional neural network. Energy, 299:131258, 2024. [9] N. Littlestone and M. K. Warmuth. The weighted majority algorithm. Comput. Eng. Inf. Sci., 108(2):212–261, Feb. 1994. [10] S. S. R. Krishnan Q. V. Pham M. P. K. Reddy M. Alazab, S. Khan and T. R. Gadekallu. A multidirectional lstm model for predicting the stability of a smart grid. IEEE Access, 8:85454– 85463, 2020. 36
[11] S. Chen Y. Liu C.-H. Zhang M. Chen, Q. Liu and R. Liu. Xgboost based algorithm interpretation and application on post-fault transient stability status prediction of power system. IEEE Access, 7:13149–13158, 2019. [12] M. W. Maier. Architecting principles for systems-of-systems. Systems Engineering, 1(4):267–284, 1998. [13] I. D. Mienye and Y. Sun. A survey of ensemble learning: Concepts, algorithms, applications, and prospects. IEEE Access, 10:99129–99149, 2022. [14] A. Aldegheishem N. Alrajeh N. Javaid, M. Akbar and E. A. Mohammed. Employing a machine learning boosting classifiers based stacking ensemble model for detecting non-technical losses in smart grids. IEEE Access, 10:121886–121899, 2022. [15] H. Oqaibi and J. Bedi. A data decomposition and attention mechanism-based hybrid approach for electricity load forecasting. Complex Intelligent Systems, 24:1–16, 2024. [16] T. Erdem P. Breviglieri and S. Eken. Predicting smart grid stability with optimized deep models. SN Computer Science, 2:1–12, 2021. [17] L. Rokach. Taxonomy for characterizing ensemble methods in classification tasks: A review and annotated bibliography. Comput. Statist. Data Anal., 53(12):4046–4072, 2009. [18] H. Kotb M. Pushkarna S. Alphonse S. Mohsen, M. Bajaj and S. S. Ghoneim. Efficient artificial neural network for smart grid stability prediction. International Transactions on Electrical Energy Systems, 2023(1):9974409, 2023. [19] K. Bohm V. Arzamasov and P. Jochem. Towards concise models of grid stability. In Proc. Int. Conf. Commun. Control Comput. Technol. Smart Grids, pages 1–6, Aalborg, Denmark, Oct. 2018. [20] Z. Li L. Zeng Y. Zhao R. Zhang et al. Z. Shi, W. Yao. Artificial intelligence techniques for stability analysis and control in smart grids: Methodologies, applications, challenges and future directions. Applied Energy, 278:115733, 2020. [21] Z.-H. Zhou. Ensemble learning. In Encyclopedia of Biometrics, Volume 1, pages 270–273. Springer, Berlin, 2009. 37