A Novel Deep Learning-Based Data Analysis Model for Solar Photovoltaic Power Generation and Electrical Consumption Forecasting in the Smart Power Grid

,


Introduction
In recent years, the electrical network benefted technical developments both in the electrical energy generation and also in the transmission and distribution side [1].In addition, advances in the industrial and social sector have enormously increased electricity consumption.In this case, the international energy agency projects a 50% increase of electricity consumption in 2050.Te overall consumption of commercial and residential infrastructure will increase by 65% between 2018 and 2050.Global CO 2 emissions will double in 2050 while investments in electricity network infrastructure are estimated at 6 billion in 2030 [2].To face these challenges, it is now necessary to use renewable sources and new information and communication technologies which make it possible to revolutionize electrical consumption using real-time management techniques in the 21st century [3].Renewable sources such as solar and wind are also used today by end consumers, which leads to variability in the electrical network, hence the need for a more fexible system in order to balance electrical demand to electrical generation at all times.
With the integration of digital technologies, a large amount of data is produced through digital equipment, sensors, phase measurement units (PMUs), smart meters, and advanced metering infrastructure (AMI).Te processing and analysis of these data represent not only the new challenge but also an opportunity for this century [4].
Te concept of smart grid and the application of artifcial intelligence methods based on deep learning for data analysis will help to face these challenges [5].Te principle of smart grid is based on solving energy problems by providing a two-way fow of energy and information between consumers and energy producers [6].However, real-time data management for decision making still represents a major challenge [7].Tis is why energy distributors worked in recent years to install a large number of smart meters in order to use these data for efective demand management.To date, the data are collected monthly by the meters, but with the implementation of the AMI, the meters record the data every 15-30 minutes; these data can reach the terabit [8].Te smart meters being installed throughout the world in recent years will thus allow the migration to the smart grid.Compared to the conventional network, the smart grid provides several advantages, in particular, automatic restoration, better integration of renewable energies, precise knowledge of network situation through smart meter deployment, and data analysis by deep learning and machine learning [9].
Similarly, smart meters now provide hourly and monthly readings of electricity consumption and thus collect a large amount of data [10].Analyzing such data can help to readjust energy consumption optimization strategies by improving the accuracy of predictive models to make them more reliable [11].Te foundations of smart grids allow automatic communication with the various electrical components in order to know the future behavior of each section using intelligent computing techniques in which deep learning techniques present a wider deployment in the literature [12,13].
However, simple machine learning models such as artifcial neural network (ANN) and SVM have many limits, which explains their low use for complex problems in electrical power systems.Moreover, these models are inefcient for high-dimensional representations with high complexities.Moreover, these models cannot be improved with large amounts of data [14].To overcome these shortcomings, learning paradigms have migrated to deep learning to take into account this abundance of data with the extraction of hierarchical components using its strong learning potential.With the complexity of smart grids, the need for deep learning is observed in the use of important data from smart meters and Internet of Tings (IoT) devices [15].For this purpose, diferent deep learning techniques have been reviewed and revised in [16][17][18] for applications in the smart grid.Additional studies and research have been done in the implementation of machine learning on renewable energies, energy storage, and the smart grid.Tese new algorithms ensuring reliable data will improve the distribution of information between machine learning and systems.It is hoped that unsupervised learning and reinforcement learning will have a central role in the energy sector but will depend on major felds in data science such as the analysis of smart grid data [19].Tese models allow having an accurate forecasting which means a prediction of the future conditions based on a large amount of digital data with the aim to make better decisions about production and consumption.

Related Works
In the literature, the deep learning models are classifed into individual models and hybrid models.

Individual Deep Learning Models.
Te individual models consider a single artifcial intelligence technique and do not include optimization algorithms.In occurrence, these methods basically include multilayer perceptron (MLP), convolutional neural network (CNN), deep neural network (DNN), recurrent neural network (RNN), shallow neural network (SNN), graph neural network (GNN), SVM, LSTM, auto encoder (AE), generative adversarial network (GAN), restricted boltzmann machines (RBM), deep reinforcement learning (DRL), gated recurrent unit (GRU), generator network (GN), and capsule networks (CNs).Deep learning models have been further evaluated in [20] for multivariate probabilistic energy forecasting.ANNs have been implemented in [21] for solar PV forecasting.In this paper, some climatic factors are proposed to predict PV generation using real-time data from solar panels in Konya, Turkey.MATLAB software was used to train the model of the ANN through three learning algorithms, namely, Levenberg-Marquardt, Bayesian regularization, and scaled conjugate gradient.Te Bayesian regularization test results gave a mean square error (MSE) of 0.00589 and a regression of 0.99999.By the Levenberg-Marquardt, the MSE and the regression are 869.15896and 0.999642, respectively.By the scaled conjugate gradient, they obtain a MSE of 2357036.87842 and a regression of 0.6742.Similarly, a new ANN model has been developed in [22] for electricity demand forecasting enhanced by population-weighted mean temperature and the unemployment rate.In order to ft a function for the monthly oscillations, a linear function based on the weighted average temperature was created.Tus, average temperatures are used as input parameters.For this purpose, records of average temperature values for cities in Turkey were used as additional input data from January 2000 to November 2019.MSE coefcients were calculated for training, validation, and test, respectively, for 3.77%, 2.02%, and 1.95%.
In [23], the CNN was proposed for the identifcation of consumer sociodemographic information.Te structure of the CNN model considers two factors, the frst for the behavior of electricity consumers and the second for the number of training samples.In this article, the CNN is tested on the dataset from the Electricity Regulatory Commission of Ireland using Python software on a Core i7-4770MQ 2.410 GHz computer with 8.0 GB of RAM.Tis dataset contains smart meter data from 4232 residential consumers over 536 days in a 30 minute interval.For the smart meter data, 80% are used for training, the rest for model testing.

2
Applied Computational Intelligence and Soft Computing Te proposed method is compared with 7 other methods including SVM, biased guess (BG), manual feature selection (MF), LS, PS, SS, and CS.Te results obtained show better accuracy than other models.In [24], a practical and efcient monitoring solution to estimate energy consumption has been proposed.Te model adopted for this purpose is an approach based on the deep convolutional neural network (DCNN).Te efectiveness of this technique is evaluated on a public dataset from the United Kingdom with an F1-score of 0.916.Similarly, a CNN architecture has been proposed in [25] for forecasting the production of renewable energies with a storage system.Te authors in [26] presented a framework for short-term residential demand forecasting as well as a method based on deep neural network and iterative resblock (IRBDNN).Data acquisition collects measurement data from household smart meters.Data preprocessing enables data cleaning, data integration, and data transformation.Te training model uses the IRBDNN for learning the correlation between consumption behaviors and the forecast of short-term electricity demand, allowing the learning of the nonlinear relationship between input and output values.In addition, an optimization step is included to improve the learnability of the proposed model.At the end, the proposed model can calculate the predicted values for each consumer.Real-world measurement data was used to evaluate the performance of the proposed model.Compared to existing models, the proposed approach presents a reduction of RMSE, MAE, and MAPE, respectively, from 20.00% to 3.89%, from 22.58% to 2.18%, and from 32.78% to 0.69%.A deep network detection scheme was presented in [27] to deal with attacks on data integrity in AC power networks.Te proposed method is based on deep reinforcement learning to avoid the problems on the dimensions that most conventional learning methods encounter.To improve the learning efciency, the authors proposed the quantization of the observation space and the concept of the sliding window.Tis method is evaluated on the IEEE 9, 14, and 30 bus test networks.Te initial state vector is determined using MATPOWER software.Te performance of the proposed scheme is evaluated using the DAE, FAE, and DF indicators.Tus, the DAE of the continuous attack detection model is 0.0237, 0.0240, and 0.1249, respectively, for the IEEE 9, 14, and 30 bus networks.Te DAE of the discontinuous attack detection model is 0.1357, 0.0490, and 1.4430, respectively, for IEEE 9, 14, and 30 bus networks.
An LSTM method was adopted in [28] to solve anomaly detection problems through consumer profles based on their recent past consumptions.Te proposed model is tested on a real dataset of 370 customers from 2011 to 2014.Te training of the model is carried out from January to December 2014.Subsequently, the authors selected anomaly profles representing 14% of the dataset for anomaly detection.Te results obtained are evaluated in terms of accuracy and recall on the number of anomalies detected correctly.Similarly, the authors in [29] developed a DNN method using LSTM as a learning model to ensure accurate prediction of renewable energy generation.Te input values of the neural architecture are irradiance, air temperature, panel temperature, wind speed, wind direction, and precipitation.Te activation functions used in the forecasting process can be hyperbolic tangent functions and rectifed linear unit (ReLU) functions.Te simulation results give a MAE of 0.035 and a MSE of 0.0023.Tese results are better than those of MA and ARIMA methods.

Hybrid Deep Learning Models.
Hybrid models are based on the original models and optimization techniques.In [30], a new hybrid model for short-term electricity demand forecasting has been proposed.Tis hybrid model is a framework that integrates a modifed mutual information (MMI), the factored conditional restricted Boltzmann machine (FCRBM), and the genetic wind-driven optimization (GWDO).Te MMI allows preprocessing and feature selection.FCRBM is a machine-based deep learning model for training and forecasting future electrical energy demand.Te GWDO makes it possible to refne the adjustable parameters of the model.Te accuracy of the proposed model is evaluated through historical data of hourly consumption in three electrical networks in the USA.In addition, the proposed model is compared with four other recent models including Bi-level, MI-ANN, AFC-ANN, and LSTM.In terms of accuracy, the proposed model exceeds the MI-ANN by 31.2%, the Bi-level by 17.3%, and the AFC by 4.7%.Te execution time of the proposed model is 52s, on the other hand, that of the AFC-ANN is 58s, the Bi-level is 102s, and the LSTM is 63s.
A combined technique using LSTM and a learning transfer approach based on XCORR has been proposed in [31] for short-term electricity demand forecasting.Te XCORR is applied between the data of the buildings to be estimated and the data of each building to be transferred.Te LSTM is trained with standardized data from these buildings.Tus, the performance values of this model are obtained through the test data.A dataset of electricity demand of buildings of Bandırma Onyedi Eylu University with a resolution of 15 minutes was used to validate the proposed model.Te accuracy of the model is evaluated using the RMSE, MAE, and MAPE with the respective values of 736.706, 352.176, and 8.145.In addition, this model has been compared with methods such as RFA, extreme gradient boosting (XGB), and light gradient boosting machine (LGBM), thus presenting better results.
To understand the efectiveness of diferent deep learning techniques, several architectures such as CNN, RNN, I-RNN, LSTM, and GRU have been studied in [32].Te CNN architecture consists of a number of convolutional layers, down sampling layers, and fully connected layers.Te RNN is an extension of the feed-forward network (FFN) in which the output of a state is taken as input to the loop structure.Te I-RNN is an extension of the RNN architecture in which the initialization of the weight matrix difers from the traditional RNN.LSTM is a variant of RNN with a gated architecture, thus capturing long-term time dependencies and avoiding gradient problems.LSTM blocks are memory cells with multiplicative adaptive gates such as input, output, and forget gates.GRU is similar to LSTM Applied Computational Intelligence and Soft Computing except that it has gate units to pass information between units.Tus, the authors, therefore, proposed a hybrid architecture based on the CNN-LSTM combination.Te proposed technique makes it possible to characterize and classify disturbances on the quality of energy in the smart grid.To this end, simulations were conducted to propose this optimal deep learning architecture with specifc network topologies.Te CNN-LSTM architecture obtained an accuracy of 0.984 with a loss of 0.15.From these results, it appears that the hybrid model is better compared to other models implemented.
Te authors in [33] proposed a novel cluster-based deep learning approach for short-term power consumption forecasting at distribution transformers.Te frst dataset contains 10 transformers while the second has 1000 transformers which make 24 million records.Te performances of the proposed model are compared with the individual models.Te precision evaluation indices are the RMSE and the MAPE.Te performances of the models are evaluated using the training and execution time.For the frst dataset, the values of RMSE, MAPE, training time, and execution time are, respectively, 2.6874 kWh, 15.9380%, 10.76 s, and 0.1070 s.For the second dataset, the values are, respectively, 21.2596 kWh, 7.2271%, 4644.82 s, and 4.57 s.In [34], a combined deep learning approach based on CNN and LSTM was proposed to detect injected measurement data in order to deal with fake data injection attacks.Te proposed method consists of ofine training based on measurement data and online detection.Tis dynamic detector can thus recognize the high-level time series characteristics of the attacks of the injected false data.An IEEE 39 bus network is used to test the fake injected data detection system.Te simulation results show a precision between 0.8 and 1 for the detection of false data injected into the various compromised buses.Moreover, the authors in [35] proposed an LSTM-CNN model for short-term load forecasting.LSTM and GBR models have been adopted in [36] to assess the uncertainties in the prediction of short-term electrical demand.Data collected by the Eastern Slovakia Electricity Corporation were used to validate the consumption forecasting models.RMSE and MAPE coefcients were used to verify the performance of the models.Te LSTM model presents a RMSE of 18.025 and a MAPE of 0.023, and the GBR model gives a RMSE of 17.42 and a MAPE of 0.023.
In [37], the authors proposed a method based on deep learning for the detection of false data cyber-attacks in a smart grid.To this end, to obtain the combined artifcial feed-forward network (AFN) model, several techniques have been proposed, in particular, CNN, RNN, and LSTM.Tis method has been implemented on an IEEE 14 bus network for the identifcation of cyber-attacks.Te results obtained show an improvement accuracy of 98.19% in the detection of false data.In [38], the authors presented an intrusion detection system for smart grid environments that uses Transmission Control Protocol (TCP) and Distributed Network Protocol 3 (DNP3).Te proposed method is called MENSA, adopting a new GAN encoder architecture.For the detection of cyber-attacks by the DNP3 protocol, the MENSA has an accuracy of 0.994, a TPR of 0.983, a FPR of 0.003, and a F1-score of 0.983.For detection in the TCP protocol, the MENSA gives an accuracy of 0.964, a TPR of 0.730, a FPR of 0.019, and a F1-score of 0.730.Tese results demonstrate that the MENSA model outperforms other machine learning and deep learning methods.Other authors have hybridized neural networks with fuzzy logic to improve data classifcation.Tus, in [39], the authors proposed an ANFIS model for the prediction of solar photovoltaic energy under diferent climatic conditions.Moreover, the authors in [40] developed a Mandani fuzzy logic system for predicting renewable energy production uncertainties by considering a variety of climate changes depending on the season.
In [41], the authors developed a hybrid model for the prediction of household electricity consumption in a smart grid system.Tus, a combined Grey-ANFIS-PSO model was built based on data from meters installed in households in order to improve the forecast of electrical energy consumption.Household electricity consumption data in Cameroon over a period of 24 years were used to validate the model.Te accuracy of the model obtained gave an RMSE of 0.20158 and a MAPE of 0.6291%.Tese results are better in comparison with single methods such as SVM and ANN.In addition, deep learning tools have also been applied for the detection and classifcation of fault, in particular, by fuzzy logic [42], by neural networks [43,44], by the Kalman flter [45,46], by the wavelet transform and the SVM [47], by the technique of decision tree and variational decomposition mode [48], by machine learning [49][50][51], by the method of refection waves [52], and by the combination of wavelet singular entropy theory and fuzzy logic [53].
Tables 1 and 2, respectively, summarize a comparative study of deep learning applications for electrical demand forecasting and renewable energy generation forecasting in a smart grid.
In this context, we propose techniques based on deep learning for electrical consumption forecasting and photovoltaic power generation forecasting.Te proposed deep learning models make it possible to generate an output prediction from climate data and socioeconomic data.
Te major contribution of this work is detailed as follows: (i) We present a general review and a comparative study of individual and hybrid deep learning techniques for smart grid applications such as forecasting electrical demand and predicting solar PV power generation.In addition, we highlight the most efcient models for prediction with the highest accuracy.
(  Te rest of the work is organized as follows.Section 3 presents the methodology and the experimental material.Here, we present prediction methods based on deep learning; we also present the proposed model.Moreover, we present the implemented software and the computer used for the implementation of the proposed hybrid method.Section 4 presents the results and the discussion, and our work is concluded in Section 5 with future directions.

. Methodology and the Experimental Setup
3.1.Methodology.In this work, we implemented fve models, namely, (i) Te multilayer perceptron (MLP) which is a neural network with several hidden layers for learning [75].(ii) Te support vector machine (SVM) which is developed using statistical tools, optimization, and neural networks and allows to create a hyper plane for data classifcation; it is used to fnd the most appropriate hyper plane for the distinction between the two classes for the separation of the data [76].(iii) Te long short-term memory (LSTM) which is a particular type of RNN used in deep learning to address long-term dependency problems; it is also excellent in the extraction of temporal characteristics for data inputs [31].(iv) Te adaptive neuro-fuzzy inference system (ANFIS) which integrates the best features of ANNs and fuzzy systems; it has both learning and reasoning capability, which improves the prediction accuracy of the model [77].(v) Te genetic algorithm (GA) which is a biological technique used for optimization; it is also a stochastic search algorithm which is inspired from natural evolution principles known as the evolutionary algorithm (EA) [78].
Considering the advantages and the limitations of previously studied models in the literature, we proposed a new combined MLP-LSTM-GA method to perform power consumption forecast and renewable energy generation forecast, taking into account socioeconomic data and variability of climate conditions.Similar models have been proposed in the literature, in particular, in [79].However, the model we proposed is completely diferent because in our hybrid model; the MLP is frst used to extract the features from the input data and then the output of the MLP is used as the input of the LSTM.Furthermore, GA allows to optimize the predictive parameters such as the bias σ, the weight ω, the cost error C, and the transfer function ϕ.Tis process allows reducing the processing time of the model.Te aim of this work is to make a long-term prediction.For this purpose, our dataset will include electrical consumption data as an output variable and socioeconomic factors such as GDP, population, number of unemployed, number of subscribers (residential, commercial, and industrial), and the price per kilowatt of electricity as input variables.
Tese data were obtained from the World Bank, the Ministry of Water, and Energy of Cameroon, the company in charge of electricity distribution and the National Institute of Statistics from 1990 to 2020.Table 3 presents this dataset.(b) Dataset for photovoltaic power generation forecasting In a smart grid, a consumer can choose either to expend energy from the grid or sell its energy back to the grid.On this principle, for proft maximization based on the selling price of electricity in the smart grid, smart homes with a PV system can determine whether the energy produced during the day should be consumed by the consumer overnight or stored in a storage cell for sale over the following days.A standard house can receive an average of 12 panels of 280 Wc each, covering an area of 20 m 2 .For this, the smart home system must predict the electrical power of the PV system for better decision making.In addition, with recent advances in sensors and data

Test of Performance
(1) Model Accuracy Coefcients.Te accuracy of the models is measured using the following coefcients: (i) Mean square error (MSE): it measures the mean square error.
(ii) Root mean square error (RMSE): it measures the square root of the mean of the square diferences between the predicted and observed data.
(v) Te mean bias error (MBE): it indicates whether the forecasts under-or overpredict on average.
(vi) Pearson's correlation coefcient (ρ): it refects the association between forecasts and observations and the potential skill of the forecasts regardless of their calibration, i.e., their bias and variance.
With σ P i representing the standard deviation of predicted values and σ O i the standard deviation of real values, (vii) Regression: it considers that the extent of the variability in the prediction errors is explained by the variability of the observed data.
P i is the predicted value, O i is the observed value, and N is the size of the dataset.O is the mean of observed value.
(2) Statistical Tests (i) Analysis of variance (ANOVA): it allows verifying if the means of the group are provided by the same population.Te ANOVA consists of explaining the total variance on size of samples depending of the variance of the model factors and interaction of With P as the mean value of predictions.(ii) Test of Wilcoxon-Mann-Whitney: it is a nonparametrical statistical test according to which the distribution of each of two groups of data are close.Te test is built using the obtained standard deviation value (σ) and the mean value (P) of the predictions.

Results and Discussion
Tis section presents the results of simulations of deep learning models implemented in our work on climate and socioeconomic dataset.Te objective is to verify the performance of the models proposed in the long-term forecast of electrical consumption and the short-term forecast of solar photovoltaic generation.

Results of the Long-Term Electrical Consumption Forecast.
Here, we have implemented power consumption forecasting using the models proposed in our work.Tus, Figure 3 shows the evolution of consumption over the past 30 years.Tere is an increase in consumption between 1990 and 1999 with consumption rising from 239 to 400 GWh.However, consumption decreased to 387 GWh in 2000 which is certainly caused by the economic crisis in Cameroon.Between 2001 and 2015, consumption increased from 387 to 1303 GWh thanks to the improvement in living conditions.Electrical consumption is stabilized around 1330 GWH in 2020.
We frst tested the MLP model in MATLAB.Training the data using MLP gave Figures 4 and 5.We also trained the LSTM model to test its prediction capabilities.Figure 6 gives the evolution of the training result of the LSTM model.
In Figure 4, we observe an evolution of the MSE for the training, test, and validation data for 10 epochs.Between 0 and 4 epochs, the MSE goes from 6 * 105 to 1540, from 5.65 * 105 to 620, and from 4.84 * 105 to 385, respectively, for training, test, and validation.However, the MSE stabilizes around 1532, 1420, and 24, respectively, for training, validation, and testing.Moreover, we observe that the best validation performance is obtained at the 4th iteration with an MSE of 620.8482.
In Figure 5, it is observed that the adjusted data are close to the real data.In addition, the correlation coefcient (R) is 0.99909, 0.99831, and 0.99688, respectively, for training, validation, and test.We then obtain a value of 0.99851 for the correlation coefcient of the MLP model.
In Figure 6, we observe the training process of the LSTM for 250 iterations.Te RMSE goes from 1 to 0.06 between the frst and the last.Moreover, the RMSE is stabilized around 0.05 around the 250th iteration.
Figure 7 gives the forecast of electrical consumption by the MLP, LSTM, SVM, and ANFIS models.Moreover, we proposed a hybrid deep learning MLP-LSTM model to improve power consumption prediction.Figure 8 presents the electrical consumption forecasting using the proposed hybrid models MLP-LSTM and MLP-LSTM-GA.In Figure 7(a), we observe that the MLP forecast follows the actual data between 1995 and 2010.However, this forecast deviates from the actual data between 2011 and 2020 which could be caused by its slow convergence.In Figure 7(b), it can be observed that the LSTM forecast follows the actual data between 2000 and 2020 with some deviations in 2002, 2003, and 2009.Between 2015 and 2020, the LSTM forecast practically merges with the actual data.Tis result shows the efectiveness of the LSTM model in forecasting consumption.In Figure 7(c), it can be observed that the SVM forecast is not efcient enough because it diverges from the actual data between 1990 and 2020.In Figure 7(d), the ANFIS model gives a better forecast than the SVM but with fuctuations in some years.However, we fnd that ANFIS is less efcient than MLP and LSTM.
Te limitations of the individual model lead us to combine the MLP and the LSTM to have a better forecast in Figure 8(a).We observe the efciency of the hybrid MLP-LSTM model in the forecasting of electrical consumption because the forecast is essentially confused with the actual data between 2000 and 2020.Moreover, with the aim to perfectly reach the highest accuracy, we optimize our hybrid model with the GA to obtain the optimal forecasting using the MLP-LSTM-GA model as shown in Figure 8(b).Tis optimized hybrid model is, therefore, better than the individual models such as the SVM, the MLP, and the LSTM.
Finally, in Figure 9, we predict an increase in consumption of up to 1508 GWh in 2030.
Figure 10 gives the comparison of the obtained prediction for each model implemented in this paper.
As shown in Figure 10, we observe that the proposed hybrid model outperforms other single models implemented in this paper with the highest performance.
In addition, we made a comparison of the forecasting models using the error coefcients.Table 5 provides a comparison of electrical demand forecasting models.
We also compared our novel hybrid deep learning model with relevant recent works in the literature about electrical load forecasting as shown in Table 6.

Results of the Short-Term Photovoltaic Power Generation
Forecast.Te photovoltaic generation predictive neural architecture is shown in Figure 11.It can be seen that it is made up of 5 input variables, in particular, irradiance, temperature, wind speed, humidity, and angle of inclination.It also has 10 hidden layers and an output layer.Te output variable being the photovoltaic energy produced.13 that the LSTM model gives a forecast rather close to the real values.Te LSTM method gives a regression coefcient of 0.99553, which shows the efciency of this model in the prediction of PV power.In addition, we observe in Figure 14 that the SVM model is just as efective in predicting PV power.However, there is a discrepancy between the forecast and the true values between 00 a.m and 05 a.m.But the forecast is accurate between 6 a.m. and 2 p.m. Tis model, despite its shortcomings, nevertheless makes it possible to have a fairly acceptable forecast with a regression coefcient evaluated at 0.99342.In Figure 15, we see that the ANFIS model has a forecasting capacity close to that of the previous models.In this case, its regression coefcient is 0.99334.Te ANFIS model can also be efective for energy prediction thanks to its neuro-fuzzy inference rules.It is clearly observed in Figure 16 that the prediction ability of the deep learning hybrid model MLP-LSTM is signifcantly superior to the previous models with a regression of 0.99716.Finally, we improve our predictor using GA to obtain a novel hybrid model named MLP-LSTM-GA model which can perfectly forecast PV power generation as shown in Figure 17 with the highest accuracy and fast convergence.Tis result can be explained by the hybridization of two efective deep learning methods in forecasting to obtain a better result.Tis method, therefore, shows its efectiveness in the short-term prediction of PV energy generation using smart meter data and historical climate data.Table 7 gives a comparison of PV power generation forecasting models.As shown in Table 7, the novel algorithm gives better results than other individual model because the features are optimally chosen using the genetic algorithm.
Ten, as shown in Table 8, we compared our obtained PV power generation forecasting results with those in the literature.It can be observed that our novel hybrid model outperforms with those in the literature with an optimal accuracy and great regression.

Conclusion and Future Directions
Tis work proposed deep learning models for consumption forecasting and solar photovoltaic power generation forecasting.To this end, we made a general analysis of the original and hybrid models of deep learning implemented in smart grid applications.In addition, we have developed deep learning methods including MLP, SVM, LSTM, and ANFIS.Tus, we proposed a new hybrid model of deep learning efcient in data training and optimization of input parameters.We frst implemented our deep learning models on a climate dataset of the city of Douala and then we implemented the novel models on a socioeconomic and demographic dataset of Cameroon over 30 years.Tus, the MLP-LSTM hybrid model gives a regression coefcient of 0.9998 for the forecast of electricity consumption and 0.99716 for the forecast of daily photovoltaic energy generation.In addition, the comparison of the results obtained shows the outperformance of the deep learning hybrid model MLP-LSTM in forecasting consumption and forecasting photovoltaic solar generation compared to other original models such as MLP, LSTM, SVM, and ANFIS.In our knowledge, it is the frst paper which can both forecast the electrical consumption and PV power generation using large amount of historical data for long-and short-term prediction.Tus, the novel deep learning models proposed in the paper can help power companies for their network implementation and the popularization of renewable energy in the future.Te limitation of this study concern the dependency of the PV power forecasting on uncertain climate conditions which can afect the accuracy of the prediction.Future works can be done on how to improve forecasting accuracy by incorporating other factors such as atmosphere pressure, precipitation, nebulosity, and sky image which their collection is difcult due to the lack of adequate sensors.Moreover, it should be interesting to explore how to combine this novel technique with other technologies such as Internet of Tings for a more robust smart system.

Abbreviations
Te MLP has 2000 neurons and the LSTM has 200 hidden units.Te initialization values of MLP are climate data and socioeconomic data.Te training time and validation time are, respectively, 300 s and 60 s.
Figure 1 shows the proposed hybrid deep learning model.Tis model works according to the following steps: (i) Input data are frst introduced into the MLP to perform preprocessing and feature extraction.(ii) Subsequently, the output of the MLP is taken as the input of the LSTM to perform the processing through training and validation in order to make a fnal and accurate prediction.During the training stage of LSTM, the network progressively predicts and updates the trained network from the previous time.Te LSTM network is trained separately for the prediction of the electrical consumption and photovoltaic power generation.Te initial network allows the training of the data of the trained system.Ten, the initial LSTM network is tested on the validation data.Subsequently, the LSTM network step by step predicts the output value on the validation data.(iii) After obtaining the prediction data from the LSTM network, the error coefcients are calculated.Consequently, a GA is implemented for feature optimization to improve the accuracy of the deep learning model.Te parameters which are optimized by the GA are the bias σ, the weight ω, the cost error C, and the transfer function ϕ.Te transfer function of mapping which we have used is quadratic radial basis function.It considers a parameter ε associated with the radial basis function which can be tuned.Ten, the GA can optimize the values σ, ω, and C. (iv) Finally, the initial network relearns and readjuststhe current data to the validation data until the error is minimized.Terefore, the fnal data are used to make the perfect forecast.

Figure 2
Figure2shows the fowchart of the general methodology of our work.As shown in Figure2, the historical and climate data are collected during a period and then we preprocess the data and operate the training and testing for each model

Figure 1 :
Figure 1: Hybrid model proposed for forecasting electrical consumption and photovoltaic power generation.

Figure 6 :Figure 7 :Figure 8 :
Figure 6: Result of the training of the LSTM model.

Figures 12 -Figure 9 :
Figure 9: Long-term prediction of electrical consumption using the proposed hybrid MLP-LSTM-GA model.

Figure 10 :
Figure 10: Comparison of the forecasting results of each model.

Table 1 :
Comparative study of deep learning applications for electrical demand forecasting.
ii) We developed four artifcial intelligence models for deep learning applications in the smart grid.In the frst model, we develop an efcient MLP architecture for data training.Te second model is the SVM used for feature extraction, classifcation, and data optimization.Te third model is the LSTM known as a variant of the RNN with input, output, and forget gates.In the fourth model, we develop an ANFIS for the classifcation and processing of data 4 Applied Computational Intelligence and Soft Computing

Table 2 :
Comparative study of deep learning applications for renewable energy power generation forecasting.

Table 3 :
Dataset for electrical consumption forecast.

Table 4 :
Dataset for solar PV power generation forecast.

Table 5 :
Comparison of deep learning models for forecasting electrical demand.
values.It can be seen in Figure

Table 6 :
Comparison with relevant recent works of the literature.

Table 7 :
Comparison of photovoltaic power generation forecasting models.

Table 8 :
Comparison with the literature on PV power generation forecasting.