A New CNN-Based Method for Short-Term Forecasting of Electrical Energy Consumption in the Covid-19 Period: The Case of Turkey

This study proposes a new convolutional neural network (CNN) method with an input-signal decomposition algorithm. With the proposed CNN architecture, hourly electricity consumption data for the Covid-19 period in Turkey were used as input data, and the short-term electricity consumption was forecasted. The input data were decomposed into its subcomponents using a signal decomposition process called Empirical Mode Decomposition (EMD). To extract the deep features, all input data were transformed into 2D feature maps and fed into the CNN. The obtained results were compared with the pre-trained models GoogleNet, AlexNet, SqueezeNet, and ResNet18. Model-wise comparisons showed that the proposed method had the highest correlation coefficient (R) and lowest root mean square error (RMSE) and mean absolute error (MAE) values for 1-h, 2-h, and 3-h. The mean R-values of the proposed method were 95.6%, 95.2%, and 94.0% for 1h, 2h and 3h ahead, respectively. The mean RMSE values were 8.2%, 8.7%, and 10.2% for 1h, 2h and 3h ahead, respectively. The experimental results confirm that the proposed method outperforms other pretrained methods despite its simpler structure.


I. INTRODUCTION
With economic development and population growth, the global energy demand and consumption are increasing daily. Developing technology and increasing purchasing power in the economy means greater energy use [1]. One of the parameters that determines the development level of countries is ensuring an energy supply-demand balance. Therefore, it is important to use energy correctly to meet demand [2]. Accurate energy forecasting is crucial, particularly for developing countries to manage their economies correctly [3].
The coronavirus pandemic has created an extraordinary situation worldwide. Coronavirus, discovered in the 21st century, is a type of virus that causes respiratory diseases [4].
The associate editor coordinating the review of this manuscript and approving it for publication was Jamshid Aghaei .
Covid-19 is different from other coronaviruses and has entered the literature as a pandemic disease by the World Health Organization (WHO). With pandemic measures being taken, people's living conditions have changed rapidly, which in turn has led to changes in energy consumption and production [5]. The imposition of curfews and the closure of public-use areas as pandemic measures increased electricity consumption in homes while reducing it in businesses such as industry [4]. The virus has had adverse effects in all areas, including health, education, finance, energy, and economy in all countries where it is seen [6]. The International Energy Agency (IEA) reported that global electricity consumption decreased by 2.5% in the first three months of 2020 [7]- [10].
In the early period, partial quarantine was implemented in some countries. Electricity consumption was reduced by at least 20% under full quarantine and to a smaller extent under partial curfew [11]. The first coronavirus case in Turkey was recorded on March 11, 2020 [5]. Therefore, restrictions were introduced across the country.
Consequently, drastic changes have occurred in energy use. Electricity consumption billed on a subscriber basis increased by 1.67% in 2020 compared with 2019 [11]. While commercial consumption decreased by 11% due to reduced usage capacities in large-scale enterprises such as hotels, shopping malls, and Istanbul Airport, residential consumption increased by 6.6%. Industrial consumption decreased in the second quarter of the year due to reduced industrial production, then increased with industrial production growth in the third quarter, and overall increased by 5.62% throughout the year [5], [11].
A. RELATED WORKS Numerous techniques have been developed for short-term load forecasting (STLF) in the literature. These techniques are generally artificial intelligence-based and traditional [10]. ARIMA, statistical models [6], time-series analysis [9], genetic algorithms [12], and fuzzy logic [13] methods are used for forecasting studies in time-series analysis [2]. Recently, machine learning methods have been increasingly used in STLF studies because they achieve more successful results in a shorter time. Machine learning methods, such as support vector regression (SVR) [14], artificial neural networks (ANN) [5], recurrent neural networks (RNN) [15], and long short-term memory (LSTM) [16] have been applied in many studies. Taylor used statistical methods for shortterm electricity forecasts.
Kaynar et al. [17] performed a forecasting study using a hybrid algorithm in which an SVR algorithm and chaotic methods were used together. Türkay and Demre [18] conducted a demand forecasting study using a library for the support vector machine (LibSVM) algorithm using load data of the years 2006-2009 [19]. Ellatar et al. [6] performed a forecasting study using the support vector algorithm hybrid model LWSVR. Mostafa and Nagasaka [20] performed a forecasting study using the SVM and ANN methods and compared the results.
Ghanbari et al. [15] compared the results of linear regression, logarithmic linear regression, and ANN using an artificial neural network algorithm. Khan et al. [21] conducted a forecasting study using an ANN and bagged regression tree (BRT). Kong et al. [16] used LSTM as an RNN for shortterm forecasting. Zheng et al. [22] applied the LSTM-RNN method to smart meter data taken from a region connected to a smart grid and compared the obtained results with the seasonal autoregressive integrated moving average (SARIMA), nonlinear autoregressive neural network (NARX), and support vector regression (SVR) methods. A performance comparison of the CNN model with the SVM, RF, decision tree, multiple linear regression, and LSTM demonstrated that the CNN model provided better results. CNN models are preferred in STLF studies because they require less memory during training and have high prediction rates.
Wang et al. designed CNN, long short-term memory-CNN (CNN-LSTM), and hybrid CNN-LSTM models and achieved better results with hybrid CNN-LSTM [23]. Zheng et al. used residual and dense network-based models [24]. Variational mode decomposition (VMD) and empirical wavelet transform (EWT) methods were also used for the input data [25]. It was observed to yield better results than the other traditional methods. proposed a hybrid forecasting model based on a deep CNN with empirical mode decomposition (EMD) and showed that the method outperforms conventional methods.
Empirical Mode Decomposition (EMD) prevents slow convergence and the presence of local minimum problems in artificial neural networks by decomposing data [24], [26], [27]. EMD is based on the local characteristics of a signal sequence and does not require predefined basic functions. Compared with wavelet decomposition, the EMD method is directly adaptable [26]. It takes advantage of multiple resolutions, and there is no difficulty in choosing a wavelet-based function for the wavelet transform [28], [29].
The literature suggests that CNN-based power forecasting methods outperform classical and AI-based methods. Inspired by the available literature, this study proposes a CNN-architecture based electrical load forecasting method.
Existing pre-trained networks may have lower performance due to their structure because they are pre-trained. In this study, the most commonly used state-of-the-art methods in the literature were preferred.
The proposed system was applied to electricity consumption data during the Covid-19 period in Turkey. The contributions of this study can be summarized as follows: • A new CNN-based model was developed to forecast the short-term electrical energy consumption with high forecasting accuracy. This model has less complexity and lower learnable parameters. Therefore, more effective CNN model was developed for forecasting task.
• To improve the forecasting accuracy and reliable, the input data were decomposed by the EMD method, and 2D feature maps were created.
• The proposed method can be easily integrated into different applications because of its simple, fast and reliable structure.
• The performance of the proposed model was assessed by comparing the obtained results with those of GoogleNet, AlexNet, ResNet18, and SqueezeNet. The remainder of this paper is organized as follows. Section 2 describes the methodology of the proposed forecasting model with details of the dataset. Section 3 presents the experiment and findings of the study, and Section 4 summarizes the results.

II. MATERIALS AND METHODS
CNN structures have generalization capabilities in big data processing, higher learning ability by inference, and processing in various ways by transforming the input data into images. Owing to these features, it provides highly successful results in image processing studies using deep learning VOLUME 10, 2022 FIGURE 1. Hourly electricity consumption data for Turkey 11.03.2020-11.03.2021. methods [23], [24], [28], [30]. Owing to these advantages, a CNN-based short-term electrical load forecasting system is proposed in this study. In this context, the aim is to obtain forecast results for 1, 2, and 3 h ahead of the network trained from the historical hourly data of the electrical load. The remainder of this section includes the CNN structure, EMD method, proposed method, and the evaluation metrics.

A. DATASET DESCRIPTION
The hourly electricity consumption data for Turkey between March 11, 2020, and March 11, 2021, one year from the first coronavirus detection date, were obtained from an open data source (transparency platform) [31]. The dataset consists of 8786 pieces of data. The electrical loads were measured in gigawatts (GW) per hour. Within the dataset, 7500 samples were used for training and validation, and the remaining 1284 samples were used for testing. The dataset for Turkey's electricity use in this one-year period is shown in Figure 1.

B. CONVOLUTIONAL NEURAL NETWORKS (CNNS)
Similar to any traditional neural network, a CNN uses layers to learn image features and decide on classification. The architecture of a CNN can vary from one network to another. In addition, CNNs generally use many common layers, and their overall architecture is shown in Figure 2. The main roles of these common layers are summarized in Table 1 [32]- [34].

C. EMPIRICAL MODE DECOMPOSITION
The Empirical Mode Decomposition (EMD) method, which is a flexible analysis method, is used for data belonging to stationary and nonlinear processes. The most important feature that distinguishes this method from the others is the intrinsic mode function (IMF), each of which represents different oscillations and is created by the local endpoints (nodes) of each oscillation, symmetrical with respect to the local mean.
These oscillations are produced separately from the signal, assuming that a randomly determined signal consists of intrinsic mode oscillations with different frequencies that are considered to belong to itself [26], [35].
To calculate the instantaneous frequency over the IMFs, the difference between the number called zero-intercept and the number of local endpoints must be at most one, and the local mean value must be zero. A local timescale must be determined to calculate the local mean value. In the EMD algorithm, the local minimum and maximum points of the signal are used.
First, two signals are obtained using the cubic curve interpolation method of the signal and its local maximum and minimum points. The local mean is obtained from the point averages of the two obtained signals. This process is repeated until the local mean value becomes zero. Once the desired value is obtained, the current IMF value is accepted and subtracted from the original signal. If the sign is no longer monotonous, the IMF index i is incrementally increased and recorded as c 1 [n] after noise elimination by subtracting the first IMF from r[n].
This process is repeated with the IMF obtained at each iteration serving as the input for the next until the values [n] become monotonous. When the monotony condition is met, the remaining [n] is called a residual signal or trend.
Finally, all the IMFs obtained after elimination are sorted from low to high. In the calculations given in Eqs. (1). The IMF represents the intrinsic mode function, n represents the number of steps in the algorithm, and r(t) represents the residual signal [24], [26].
The five components and residues obtained are shown in Figure 3, with each component representing different properties of the data.

D. PROPOSED DEEP FORECASTING METHOD
The proposed method comprises four main stages. These are the decomposition of input data with EMD, mapping, training, and testing of the model, and the final decisionmaking of the network. The proposed method makes shortterm forecasting of electricity consumption for 1, 2, and 3 h based on hourly electrical load data. In the first step, input X (t) is created as a time series. Then, the load data are decomposed using the EMD method. Thus, time series and subload series were created. Then, the output load y(t) is normalized to obtain better performance. The input dataset was converted into a 2D RGB image. Each of these images represents the input data and is later used as an RGB image as the input to the CNN structure. The input images are then resized, and all subsets are randomly selected for training, validation, and testing. Then, the CNN-based deep network was trained, and validation was performed every 10 iterations. The training and validation sets were used as inputs and the test set was used during the testing stage. Finally, the best-performing CNN model is obtained and used. The retrained network forecasted the electricity consumption load and determined the forecast performance. The general architecture of the proposed forecasting model is illustrated in Fig. 4.

E. PRE-PROCESSING AND RECONSTRUCTION
The main purpose of data pre-processing and reconstruction is to create input maps that are easier to interpret and learn for the CNN. First, normalization was applied to the historical dataset in the range of [0-1]. The IMFs for each date were converted to the HSV color space and represented by an RGB image with a resolution of 5 × 13, as shown in Figure 4. Input can be given as feature maps and fi;k., i, and k represent the number of features and samples, respectively. Here, k = 1, 2, 3, . . .; M and M are the total historical samples. Deep input feature maps were obtained, as shown in Figure 5. Each feature has a size of r1 × r2 pixels, and the input image is created by combining r2 pixels. Therefore, each image defines an input channel,. After reconstruction, all images were resized to 227 × 227 pixels and shuffled to achieve better training performance.

F. EVALUATION METRICS
Three performance metrics are statistically calculated to evaluate the quantitative performance of the proposed model. These are the correlation coefficient (R), root-mean-square error (RMSE), and mean absolute error (MAE). The R value measures the strength of the relationship between input and output. The RMSE is a quadratic metric that measures the magnitude of error of a machine learning model, which is often used to determine the distance between the forecaster's predicted values and the actual values. RMSE is the standard deviation of the prediction errors (residues). The MAE is a measure of the difference between two continuous variables.
Because the MAE value is easily interpretable, it is frequently used in regression and time series problems. These metrics can be expressed by the following equations (2)(3)(4): (2) 22590 VOLUME 10, 2022

RMSE
where P and P f are the measured and predicted loads, respectively.P andP f are the means of the measured and predicted load data, respectively. Among these performance measures, R is the accuracy coefficient of the model. A high R value indicates a good prediction. Because RMSE and MAE are error measures, lower values indicate higher performance [18], [23].

III. RESULTS AND DISCUSSION
This section presents experiments and evaluations of the proposed forecasting method. The proposed method was evaluated and discussed by comparing it with well-known pre-trained deep learning models. All experiments were performed with Intel in a MATLAB environment (R) with i7-10750 H CPU @2.60 GHz, NVIDIA Quadro P620 GPU, and 16 GB RAM memory. The input data set was decomposed and applied to all models.

A. PRE-TRAINED NETWORKS
Various pretrained CNNs have been trained on over one million images. These pre-trained CNNs can be trained using the new dataset, adapted, and fine-tuned for typical classification. The performance characteristics of the proposed CNN model in this study were compared with those of the pre-trained network models ALexNet, GoogLe-Net, SqueezeNet, and ResNet18, as summarized in Table 2 below [36]- [39].

B. PROPOSED MODEL
As mentioned before, the dataset was decomposed using the EMD method and sized 150 × 72 × 3 for the proposed CNN method input. The structure of the CNN model is VOLUME 10, 2022  summarized in Figure 6, and the dimensional parameters of the layers are listed in Table 3. For instance, the filter size in the first convolution layer was assigned as 3 × 3, that in the second layer was 5 × 5, and that in the third layer was 7 × 7. The max-pooling layers were assigned as 3 × 3 and 2 × 2, respectively. The fully connected layers (fc2 and fc3) were chosen as 750 and 1000, respectively. The selected parameters were determined based on the best accuracy rate obtained during the experiments. The number of learnable parameters of the proposed model is about 9 million, and SqueezeNet has 1.2 million, GoogleNet has 7 million, AlexNet has 61 million, and Resnet-18 has 11.7 million learnable parameters. The proposed network has fewer learnable parameters than trained networks like AlexNet and Resnet-18. The proposed model is a serial network and produces faster results than cascade models.

C. EXPERIMENTAL STUDIES
In the experiments, 7500 data points from 8786 samples between March 11, 2020, andMarch 11, 2021, one year from the first coronavirus detection date, were used for training and validation, and the remaining 1284 data points were used for testing. These data were selected based on the hourly  samples. All the data were shuffled to avoid the negative effects of overfitting. Thus, robust decision-making performance is obtained for forecasting. After training the proposed CNN. Model, electricity consumption forecast values for 1-h, 2-h, and 3-h ahead were obtained. For the performance evaluation of the model, electricity consumption forecast values for 1-h, 2-h and 3-h ahead were also obtained with other pre-trained models. The model performance metrics are summarized in Table 4 and Figure 7. The electricity consumption forecast values of the models for 1-h, 2-h, and 3-h ahead were obtained, as shown in Figures 8-10.

D. DISCUSSIONS
In this part of the study, studies on short-term load estimation of electric load are included. In this regard, the model, forecasting horizon, data context, and success rates of the model of these studies are presented in Table 5.
When the studies selected in Table 4 are examined in terms of datasets, it can be seen that specific datasets are used in the experimental studies, and short-term load estimation is used in the datasets in all studies. VOLUME 10, 2022  In this regard, a study was conducted to estimate weekly and monthly electrical load using the ANN method using 5-year hourly electricity load data for Pakistan in reference [39]. In the study, an RMSE value of 51.783 was obtained.
In the study in reference [40], a 24-hour electrical load estimation study was conducted using two different data sets with Temporal Convolutional Network (TCN) with channel and Temporal Attention Mechanism (AM). Two different datasets were used for the study. While the first dataset includes the electrical load of 5 years (one sample point every 15 minutes) and meteorological factors (temperature, humidity, and precipitation), the second dataset includes the electrical load of 1 year (one sample point every minute) and meteorological data (including nine meteorological records).
In reference [42], a single household customer based on an extensive database from Australia is used. The estimation study used the pyramid-based CNN method, and the estimation study was conducted 24 hours ahead. The MAE value of the performance measures was 39%.
For New England, USA, and Switzerland, listed in reference [43], the electric charge data were taken, and the estimation was performed one hour ahead. The CNN-LSTM hybrid model was used as the estimation model, and the performance ratios RMSE, MAPE, and MAE were determined to be 203.23 kW, 2.02%, and 142.23 kW, respectively.

IV. CONCLUSION
The Covid-19 period has caused sudden changes in living conditions worldwide, and people's living conditions have changed in a short time. Along with this extraordinary change, the use of electricity has also differentiated. People started working at home and production decreased. Forecasting electricity consumption values is very important for countries to meet their electricity needs in extraordinary situations and create the necessary infrastructure. This study developed a CNN forecasting model for 1-h, 2-h, and 3-h ahead of hourly electricity consumption data between March 2020 and March 2021, a 1-year period after the first corona case in Turkey. The load data used for forecasting in the model were first decomposed using EMD. All data were then converted to the HSV color space. After the concatenation process, the data were input into the proposed CNN model.
The proposed model was also compared with other pretrained models and was found to show the best performance. As is known, GoogleNet, AlexNet, ResNet18, and SqueezeNet are pre-trained. Therefore, they provided lower results in the estimates.
The mean R-values of proposed method were being as 95.6% for 1-h ahead, 95.2% for 2-h ahead, and 94.0% for 3-h ahead, respectively, The lowest RMSE value of the proposed model ranged 8.2% to 10.2% for 1-h ahead to 3-h ahead, respectively. After the proposed model, AlexNet provided the best second metric values, which are 0.945-0.920-0.915 for R, 0.091-0.115-0.118 for RMSE and 0.069-0.087-0.092 for MAE under all forecast horizons, respectively. The simple structure of the proposed model allows relatively for a shorter training time than other models. Future studies should investigate the association between different parameters and electricity consumption. In addition, further research will be conducted in the field of electricity consumption analysis with more potential deep-learning methods.