Abstract This has increased the pace at which decentralized smart grids have been used to provide more reliable and sustainable energy management by integrating dispersed energy resources and prosumers to enhance the efficiency and resilience of the system. The issue of grid stability in such systems is large and requires sophisticated models that can predict and describe phenomena. The UCI Electrical Grid Stability Simulated dataset was used to train and test a number of ML algorithms, such as Adaboost, ANN with Multilayer Perceptron, Gradient Boosting, KNN, LR, Naive Bayes, RF, Stochastic Gradient Descent Classifier, Support Vector Machine, and XGBoost. To understand the accuracy, precision, recall, F1-score, and the confusion matrix, we checked its performance. The ANN model did the best, with an AUC of 99.4%, an accuracy of 97.0%, a recall of 98.3%, and an F1-score of 97.6%. Explainable AI approaches such as SHAP and ICE ensured that the model was comprehensible as it displayed significant features, which influenced stability. A hybrid stacking classifier, which incorporated Bagging with Random Forest, AdaBoost, and Bagging with KNN and LightGBM, was applied to make even a better prediction. This increased precision to 97%. In addition, the model was made more transparent with the help of LIME and SHAP that provide clear explanations of the importance of each characteristic. A user interface based on Flask was also made, which lets users make real-time predictions using stored model artifacts, StandardScaler, and LabelEncoder preprocessing. This simplifies its use and understanding to predict smart grid stability in a decentralized manner. Keywords: Decentralized Smart Grid, Machine Learning, Explainable Artificial Intelligence, Grid Stability, ANN, SHAP, LIME, Hybrid Stacking Classifier 1. Introduction The use of Smart grids is an emerging form of electrical energy management. They utilize the latest communication technologies, intelligent control systems, and renewable energy sources to achieve a more efficient production, distribution, and consumption of electricity 1, 2. Smart grids are not ordinary electricity grids, as they allow you to monitor those in real-time, adjust their parameters and make decisions using data. This renders them more efficient, reliable and sustainable 3, 4. With the addition of more dispersed energy resources and prosumers, people or businesses that can use and generate electricity, to the grid it has become more difficult to control the movement of energy and maintain the system in equilibrium 5. Decentralization of modern grids provides flexibility and resilience, although it complicates these grids to manage issues such as shifting supply and demand curves, intermittent renewable energy, and localized disruptions 6, 7. DSGC employs the local measurements and sophisticated analysis techniques to enhance energy balance, reduce the necessity of centralized systems, and reduce the probability of instability 1, 8. The large volume and ever evolving data generated by smart grids have been extensively dealt with using ML techniques. Such algorithms have proved to be very accurate in identifying and detecting anomalies 2, 3 and 9. Although numerous ML models can be used to make predictions, they are often difficult to comprehend, thereby being less credible to the stakeholders 4, 5. This challenge has seen XAI methods, such as SHAP, LIME, and partial dependency analysis, provide easy-to-understand information on the importance of a feature, as well as how models arrive at decisions 6, 7, 10. Such practices can assist operators to determine the most significant influences on stability and make intelligent control choices. The primary objective is to offer a robust predictive and interpretative model of the stability of smart grids through both a high-performance ML modeling and explainable AI approaches. The aim of this method is to increase the reliability of operations, clarity in decision-making and the possibility of real-time interventions, which will eventually help to operate the decentralized energy systems in a more efficient, understandable and robust way. 2. Related Work Notable advances in smart grid technology of late have made it apparent that there is a need to have sophisticated methodologies of monitoring, predicting and controlling in order to have reliable and sustainable energy management. Many studies have investigated the combination of ML and artificial intelligence to make the grid more stable, better distribute energy, and identify problems 11, 12. As an illustration, it has been proposed that self-healing controlled devices be used to ensure the stability of smart grids in transmitting and distributing electricity. This would enable automatic problem detecting and response mechanisms 11. These types of systems demonstrate how intelligent control systems can keep the power flowing continuously and use less on centralized infrastructure. ML has been extensively used by people to determine the extent to which smart grid systems are stable and also to discover unusual phenomena. The neural networks and other ensemble classifiers are all examples of supervised learning methods that have shown significant potential in addressing the dynamic nature of energy consumption and production 12, 13. Distributed learning-based anomaly detection algorithm has proven valuable to decentralized grids. They allow various energy nodes to collaborate to detect abnormal patterns without transmitting sensitive information, maintaining privacy and at the same time allowing them to draw appropriate predictions 12. Also, researchers have looked at probabilistic ML methods to deal with the uncertainties that come with integrating renewable energy and changing demand. These techniques provide confidence intervals of forecasts and are useful in making risk-aware decisions by people 13. XAI has become an interesting area in the context of smart grids to enhance the clarity and visibility of prediction models. The most significant factors that influence grid stability have been discovered using techniques such as SHAP, LIME and feature importance ranking. This assists operators to know how the model arrived at its judgments and make the appropriate actions to correct the issues 14, 15. It has been demonstrated that interpretable models are essential towards the promotion of confidence and reliability, as well as the regulation compliance and operational safety, in particular, in systems that involve renewable and distributed energy sources 14. Application of the XAI methods based on high-performance predictive models ensures that intelligent energy management systems are accurate and understandable, which is essential in their application in the real world. A number of studies also have examined the way to ensure computers perform faster without compromising on the ability to arrive at correct predictions. To manage vast amounts of smart grid data with less lag time, researchers have suggested using low-computational-cost convolutional neural networks and hybrid ML frameworks. This would enable real time nearly real time decisions to be made on stability prediction 16, 17. In addition, hybrid fusion strategies involving multiple classifiers, e.g. bagging with random forest, boosting and ensemble methods have been demonstrated to result in more accurate predictions and less susceptible to noisy or missing data 17, 18. These methods show how important it is to use ensemble learning and feature fusion techniques to make grids more resilient when they are under a lot of stress. Smart grids are also using ML to detect defects and cybersecurity. The reason is that the problems of energy theft, cyberattacks, and system failures are on the rise 16, 19. Strange behavior and intrusions have been detected in real time by intelligent algorithms to take measures to safeguard key infrastructure and ensure its smooth running. The methods of feature selection and balancing data have enabled the models to be even more dependable and able to provide correct projections even in cases when the data is unbalanced and has anomalous events such as unexpected load changes or equipment failures 18, 20. Lastly, studies have emphasized the importance of smart grid monitoring with real-time statistics and user-friendly interfaces. Predictive modelling, interactive dashboards, and real-time alarms can help operators effectively run decentralized energy systems, handle expected instabilities, and maximize energy flow 11, 20. It is evidenced by such integrated structures that scalable and explainable systems that can bridge the gap between powerful analytics and viable energy management can be made possible. 3. Materials And Methods The proposed solution leverages ML and explainable artificial intelligence to attempt to determine how stable decentralized smart grids would be. UCI Electrical Grid Stability Simulated dataset is taken as it has many different attributes which are indicative of the grid behaviour in various situations. Normalization is done by using StandardScaler and category encoding is done using LabelEncoder to ensure all the models will present the same data. Best prediction model is found by applying a variety of techniques, including ANN, RF, Gradient Boosting, KNN, LR, Naive Bayes, Adaboost, SGDClassifier, SVM and XGBoost. In order to address the challenge of interpretability, Explainable AI methods such as SHAP and ICE are combined to provide feature-level explanations and highlight key factors influencing the stability outcomes, which the past research on interpretable grid modeling has highlighted 23, 25. The innovation lies in that it involves combining advanced learning methodologies and interpretability, which ensures the predetermined accuracy and the ability to make clear decisions. Fig.1:System Ar
Patil et al. (Thu,) studied this question.