Next Article in Journal
Variance of the Infection Number of Heterogeneous Malware Spread in Network
Previous Article in Journal
Design and Additive Manufacturing of TPMS Heat Exchangers
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Deep Learning Approach for Short-Term Electricity Demand Forecasting: Analysis of Thailand Data

by
Ranju Kumari Shiwakoti
1,
Chalie Charoenlarpnopparut
1,* and
Kamal Chapagain
2
1
School of Information, Computer, and Communication, Technology Sirindhorn International Institute of Technology, Thammasat University, Pathum Thani 12120, Thailand
2
Department of Electrical and Electronics Engineering, Kathmandu University, Dhulikhel P.O. Box 6250, Nepal
*
Author to whom correspondence should be addressed.
Appl. Sci. 2024, 14(10), 3971; https://doi.org/10.3390/app14103971
Submission received: 28 March 2024 / Revised: 1 May 2024 / Accepted: 1 May 2024 / Published: 7 May 2024
(This article belongs to the Topic Short-Term Load Forecasting)

Abstract

:
Accurate electricity demand forecasting serves as a vital planning tool, enhancing the reliability of management decisions. Apart from that, achieving these aims, particularly in managing peak demand, faces challenges due to the industry’s volatility and the ongoing increase in residential energy use. Our research suggests that employing deep learning algorithms, such as recurrent neural networks (RNN), long short-term memory (LSTM), and gated recurrent units (GRU), holds promise for the accurate forecasting of electrical energy demand in time series data. This paper presents the construction and testing of three deep learning models across three separate scenarios. Scenario 1 involves utilizing data from all-day demand. In Scenario 2, only weekday data are considered. Scenario 3 uses data from non-working days (Saturdays, Sundays, and holidays). The models underwent training and testing across a wide range of alternative hyperparameters to determine the optimal configuration. The proposed model’s validation involved utilizing a dataset comprising half-hourly electrical energy demand data spanning seven years from the Electricity Generating Authority of Thailand (EGAT). In terms of model performance, we determined that the RNN-GRU model performed better when the dataset was substantial, especially in scenarios 1 and 2. On the other hand, the RNN-LSTM model is excellent in Scenario 3. Specifically, the RNN-GRU model achieved an MAE (mean absolute error) of 214.79 MW and an MAPE (mean absolute percentage error) of 2.08% for Scenario 1, and an MAE of 181.63 MW and MAPE of 1.89% for Scenario 2. Conversely, the RNN-LSTM model obtained an MAE of 226.76 MW and an MAPE of 2.13% for Scenario 3. Furthermore, given the expanded dataset in Scenario 3, we can anticipate even higher precision in the results.

1. Introduction

1.1. Background

The electricity consumption within a society serves as a significant indicator of its sustainable development, encompassing both economic and environmental aspects. Consequently, ongoing research aimed at addressing electricity consumption issues is crucial for supporting various domains [1]. Accurate forecasting is a critical need in electricity markets. Additionally, it plays a significant role in ensuring the security of the power system [2]. There are typically three types of electricity load forecasting based on the period of forecasting; these are short-term load forecasting (covering minutes to one day ahead), medium-term load forecasting (spanning weeks to months), and long-term load forecasting (projecting years ahead) [3]. Short-term load forecasting (STLF) is useful for utilities in predicting energy demand during peak hours and preparing for potential supply shortages. Additionally, it assists electricity market participants in managing energy trading activities and mitigating risks arising from sudden fluctuations in demand or supply [4]. It was observed that 80% of the electrical energy demand forecasting concerned STLF, while MTLF and LTLF accounted for 15% and 5%, respectively. STLF has the highest priority because of its critical role in the daily operational scheduling of power systems, guaranteeing grid stability and maintaining supply and demand in real time. While MTLF and LTLF are critical for strategic planning and infrastructure development, they may not be as urgent in addressing immediate operational challenges, which justifies the more limited research focus [5]. Thailand’s electrical supply comprises three main entities: the Metropolitan Electricity Authority (MEA), the Electricity Generating Authority of Thailand (EGAT), and the Provincial Electricity Authority (PEA), where EGAT manages power generation. Our paper focuses specifically on the metropolitan regions within Thailand [2].

1.2. Challenges

Short-term load forecasting plays a vital role in the energy industry, as precise predictions of future electricity demand are essential for maintaining the reliable and efficient operation of power systems [6]. Weather conditions, economic trends, consumer behavior, and unforeseen events such as natural disasters all have an impact on load data, leading to fluctuations that make accurate forecasting difficult, especially over long periods [7]. Deep learning models can independently learn detailed patterns and relationships while adjusting to variations in the data-generating process. However, the training and deployment of these models demand substantial amounts of data and computational resources [8]. Energy systems are constantly evolving, influenced by policy changes, technological advancements, and market fluctuations. Researchers are consistently attempting to enhance existing forecasting models to mitigate the occurrences of both under and over forecasting, depending upon the effects of these influential parameters [9]. In this context, researchers face significant challenges in minimizing prediction errors. Their task involves developing sophisticated models and thoroughly testing them across diverse datasets, including commercial, residential, and collective loads [10].

1.3. Load Forecasting Models

Conventional statistical models include regression models, such as linear regression models, multiple regression models, stepwise regression models, logistic regression models, and polynomial regression models [11], where moving average (MA), autoregressive moving average (ARMA), autoregressive integrated moving average (ARIMA), autoregressive integrative moving average exogenous (ARIMAX), and seasonal autoregressive integrated moving average (SARIMA) are popular in statistical forecasting models [12]. For non-real-time forecasting, these models are useful, but they have no accuracy with respect to actual time load and no ability to regulate the consumption of non-linear loads [13].
Short-term electrical demand forecasting powered by AI is crucial for optimizing energy generation and distribution, allocating resources effectively and maintaining power network stability [14]. AI-based models, including traditional machine learning (ML) and deep learning (DL) models, were introduced to handle non-linear relationships in load consumption. Traditional machine learning methods, such as support vector machines (SVM), random forests (RF), and decision trees (DT), can capture complex correlations between several factors affecting energy consumption. ML models consist of artificial neural networks (ANN), particle swarm optimization algorithms (PSO), genetic algorithms (GA), fuzzy logic, and expert systems [15]. Feed-forward neural networks (FNNs) simulate complex relationships between inputs and outputs by adjusting parameters. However, they can suffer from overfitting and may not always find the best solution, becoming stuck in a local optimal state. To overcome this, backward propagation learning is often used in FNN training [8]. To overcome the complex ML problems, DL models were introduced, such as the deep neural network (DNN), the recurrent neural network (RNN), long short-term memory (LSTM), the convolutional neural network (CNN), gated recurrent units (GRU), and the deep belief network (DBN), which have been used for STLF [16]. A modification of RNNs, the LSTM network was created by Hochreiter and Schmidhuber in 1997 to address the vanishing and exploding difficulties in RNNs [17]; it solves time series data problems by memorizing all input information. GRU were introduced to address vanishing and exploding gradients using the concepts of gated cells, like in LSTM, which exists in RNN due to long-term dependencies. So, this is the model for improvement based on RNNs.
This research is related to short-term electrical demand forecasting by using a half-hourly recorded demand dataset from Thailand. There is a lot of previous work related to demand data from EGAT, applying different models by using either all or part of a 5-year period (from 1 March 2009 to 31 December 2013), which is mentioned in table in Section 2. We used a dataset from EGAT, covering about 7 years (from 1 January 2012 to 31 December 2018), with the same half-hourly pattern of demand. Identifying the optimal DNN model based on forecasting accuracy is the primary goal of this work. This paper makes the following significant contributions:
  • Based on testing and validation accuracy, a comparative analysis of deep neural networks for simple RNN, LSTM, and GRU is discussed.
  • Splitting the complete 7-year demand dataset into three distinct scenarios, encompassing working days, non-working days, and the entirety of the dataset, based on shared demand characteristics, enhances prediction accuracy compared to prior studies using Thai datasets.
  • Combining hyperparameter tuning (dropout, epoch, lookback period, number of neurons per layer, number of layers, etc.) to determine which model performs best.
  • This paper addresses a gap in the literature by utilizing deep learning techniques to model the EGAT dataset spanning from 2012 to 2018. Previous studies have tested the EGAT dataset from 2009 to 2013 using various models, as outlined in table in Section 2.
The remainder of this paper unfolds as follows: Section 2 explores related literature; our modeling approach, including the principles supporting DNNs and the methodology for model estimation, is described in Section 3; Section 4 states the features of electricity demand data and examines pertinent variables; Section 5 determines the model framework, details the expansive experimental setup, and closely examines the forecast accuracy and model fit quality using the Thai dataset; after this, Section 6 furnishes the findings along with comprehensive discussions, while Section 7 as the concluding section.

2. Related Works

The nature of the data, the accessibility of previous observations, and the forecasting goal have an impact on the decision to use a time series model. Building efficient time series models requires careful consideration and analysis of trends and seasonality, feature engineering, and model selection [15]. Kernel-based multitask learning has been shown to be effective in addressing electricity demand forecasting difficulties. Fiot et al. developed kernels that consider various seasonal patterns to specifically address the complicated task of forecasting individual customer demand [18]. Dudek et al. presented the principles of the pattern-similarity-based methods for short-term load forecasting and similar-pattern-based local linear regression models using Polish power system data [19]. The proposed stepwise and lasso regression methods have been suggested to decrease the number of predictors and have shown superior performance when compared to other models such as ARIMA, ES, ANN, and the Nadaraya–Watson estimator. Ismail et al. [20] used an MLR model with a day-ahead forecast MAPE of 1.71% to examine the effects of temperature and holiday types. In addition to artificial intelligence, linear regression was contrasted with other conventional and adaptable techniques for selecting weather variables and identical energy prediction, such as seasonal ARIMA (SARIMA) and regression ARIMA (RegARIMA) [20]. Lusis et al. evaluated calendar effects and forecast granularity of STLF using regression trees, neural networks, and SVR with root mean square error (RMSE) and normalized RMSE as forecast error metrics [10]. Zhang et al. [21] proposed improved adaptive rules for the genetic algorithm, which demonstrated superior performance compared to the traditional genetic algorithm (GA) in optimizing support vector regression (SVR) and enhancing forecasting accuracy for hourly electricity demand. Additionally, it outperformed the extreme learning machine (ELM) model and various artificial neural network models [21]. Certain scholars have utilized machine learning models to improve their performance by enhancing training models, iterations, hyperparameters tuning, and other different techniques. Khwaja et al. proposed the boosted neural network (BooNN) model, which combines a set of ANNs iteratively, and then compared it with simple ANN and bagged neural networks (BagNN) [22]. Similarly, they proposed the joint bagged-boosted ANNs that train an ensemble of multiple ANN models in parallel, creating individual ANNs and combining the individual ANNs. Then, the generated results of the proposed model were compared with those of single ANN, BoostNN, and BagNN [23].
The attraction of the RNN-based LSTM and GRU networks among researchers is due to their capacity to manage sequential data and dependencies over time and to discover complicated patterns in the data [24,25]. Recent improvements in computation and algorithms have resulted in the development of DNN as the primary approach for forecasting electricity demand. This is due to their ability to enhance the feature abstraction capability of the model. Chen et al. presented a modified deep residual network with a two-stage ensemble strategy to enhance the generalization capability [26]. When compared to other models, deep learning (DL) experiments possess outstanding abilities in managing complex non-linear relationships, model complexity, and computational efficiency. Din et al. investigate and evaluate the effectiveness of feed-forward DNN and recurrent deep neural network (R-DNN) models in terms of accuracy and computational efficiency, and the generated results show that the use of transfer function feature analysis with DNN enables higher accuracy [27]. Li et al. [28] assessed the efficacy of LSTM and FNN models for electricity demand prediction, scrutinizing their preciseness and resilience. Their work underscores LSTM’s expertise in capturing complicated long-term patterns in electricity demand data [28]. Hybrid DNN models have been used in electricity demand prediction in addition to LSTM and FNN. To improve the reliability of short-term demand for electricity forecasting, Stosovic et al. recommended five distinct recurrent neural network architectures. In terms of accuracy, this study revealed that the GRU and bidirectional LSTM model surpassed the conventional FNN and RNN models, indicating the possibility of combining several machine-learning techniques for enhanced forecasting performance [29]. Xiao et al. used a hybrid forecasting model for electrical power prediction that incorporates ANN, including BPNN, the generalized regression neural network (GRNN), the Elman neural network, and an optimized model (GA-BP) neural network, in to half-hourly electrical power data of the State of Victoria and New South Wales of Australia [30]. The ensemble approach has lately gained popularity among researchers because of the improved prediction accuracy that has been demonstrated. For the management of the power system, a survey of demand forecasting models was conducted [31]. Gao et al. [32] introduced an adaptive deep-learning load forecasting framework by integrating transformer and domain knowledge. Adaptive-TgDLF effectively combines the transformer model with human insights to enhance short-term electrical load forecasting. It introduces adaptive learning to tackle data scarcity and changing load patterns, marking a significant advancement in this area of research [32]. The researchers explored model predictive control for adjusting power production and distribution strategies in response to predicted demand, thus preventing delays and optimizing resource use. By precisely predicting short-term load demand, services can enhance grid stability, reduce costs, and boost efficiency [33,34].
The SLTF works for Thailand appear to have only lately surfaced. Hence, numerous studies have been conducted in Thailand to forecast power consumption using various approaches and strategies. Several studies [2,35,36,37,38,39] utilizing data sourced from the Bangkok metropolitan region have been published, recorded by the Electricity Generating Authority of Thailand (EGAT) between 2009 and 2013.
Chapagain and Kittipiyakul implemented calendar elements, including the year, month, day, and hour, as well as seasonal elements like holidays and special days, which were considered to be the factors driving demand in [2], and used them, together with other crucial variables, to construct numerous predictive models. These elements are typically referred to as deterministic variables. When compared to demand on weekends, weekday demand exhibits dramatically distinct patterns. Due to the existence of industrial sector activity on weekdays, weekday demand is specifically much stronger and more consistent than weekend demand. Weekend and weekday holidays both have significantly lower energy demand than weekday demand. In order that the various weekday patterns would be identified, we needed to create dummy variables that represented each day of a week as either weekdays, weekends, or holidays (whether on weekdays or weekends) [40]. Various researchers have generated noteworthy findings based on the identical EGAT dataset spanning from 2009 to 2013. These findings are summarized in Table 1.

3. Theoretical Background

This chapter presents the theoretical background of all terminologies and an explanation of the proposed model. Deep learning techniques, such as RNN, RNN-LSTM, and RNN-GRU, are utilized to forecast future short-term electricity demand. Forecasting electrical load presents distinct challenges, including seasonality, periodicity, non-linearity, and sequential interdependence within consumption data sequence, which deep learning architectures are especially well-suited to address. By using non-linear modifications and extracting high-level abstractions, deep learning models, as opposed to shallow ANN architectures, can automatically learn complicated temporal patterns [43].

3.1. Deep Neural Network

The DNN is one of the neural networks with an input layer, an output layer, and many hidden layers (more than two). It includes an input layer (xi), an output layer (yi), and more than two hidden layers (hi), as shown in Figure 1. It trains as a feed-forward network to generate the corresponding output values through all hidden layers and neuron nodes in forward propagation. The non-linear activation function f takes a weighted sum of input X values and returns an output Y value, as indicated in Equation (1), where W j k l = the weight between node j in the layer (l−1) and node k in layer l.
Y i = f i = 1 t W j k l X i

3.2. Recurrent Neural Network

The RNN is defined as an extension of a feed-forward neural network (FNN), with feedback connections that can detect short-term non-linear time relationships. Williams and Zipser created the first RNN in the late 1980s, a time of rapid advancement in neural network construction research that resulted in multiple essential discoveries [44]. RNN computes new states by recursively applying transfer functions to previous states and inputs. This process determines how information is passed between neurons and is critical for creating a learning system that can perform well under different conditions [45].
In terms of prediction, an RNN is trained using input data x(t) to generate a desired output y(t). Figure 2 illustrates the unrolled architecture of an RNN across the t-time dimension with LN layers. Each time step t features neurons in the hidden layer, which can be viewed as a single layer within an FNN. At time step t, the parameters of the network neurons at the lth layer update their shared states using the following equations [46]:
α 1 t = b 1 + W 1 h 1 t 1 + U 1 x t ,
h l t = Activation   function   α l ( t ) for l = 1 , 2 , , N ,
α l t = b l + W l h l t 1 + U l h l 1 ( t ) for l = 1 , .. , . N ,
y t = b N + W N h N t 1 + U N h N ( t ) ,
L = loss function (y(t), ytraget(t)),
where x(t) denotes the input data at the tth time step; y(t) represents the corresponding prediction; ytarget(t) signifies the true values of output targets; h l ( t ) indicates the shared states of lth network layer at time step t; and α l t depicts the input value of the lth layer at time step t, comprising the tth time step input x(t) or the shared state h l 1 ( t ) at time t from the (l − 1)th layer, bias b, and shared states h l t 1 at current network layer l from the previous time step (t – 1).

3.3. RNN-Based Long Short-Term Memory

Despite extensive research, the non-stationary demand data and the long-term forecasting horizon of the STLF make it difficult to obtain an accurate estimate. The capacity of LSTM to identify long-term dependencies in a time series is its key benefit. The LSTM representation was chosen as one input because it contains methods that account for the sequential character of time series. Therefore, we utilized the LSTM, a specialized form of RNN architecture, to tackle the short-term load forecasting challenge [47,48].
The memory cell, which acts as an accumulation of the state information, is the primary innovation of the LSTM. Three functions of gate controllers are demonstrated as follows [49]:
Forget gate f ( t ) decides which part of the long-term state c ( t ) should be omitted.
Input gate i ( t ) controls which part of c ~ t should be added to the long-term state c ( t ) .
Output gate o ( t )   determines which part of c t should be read and outputs to h ( t ) and y ( t ) .
The forget gate is used to determine which information to remove from the cell state, as seen in Figure 3.
f ( t ) = σ   ( W f ·   h ( t 1 ) , x ( t ) + b f )
i ( t ) = σ   ( W i · h ( t 1 ) , x ( t ) + b i )
c ~ ( t ) = tanh ( W c · h ( t 1 ) , x ( t ) ) + b c
c ( t ) = f ( t ) c ( t 1 ) + i ( t ) c ~ ( t )
In conclusion, it is necessary to decide on the output, which involves two steps. First, a sigmoid layer is utilized as an output gate to selectively filter the cell state. Subsequently, the cell state is passed through a tanh function and multiplied by the output o t to obtain the desired information.
o ( t ) = σ   ( W o · h ( t 1 ) , x ( t ) ) + b o
h ( t ) = o ( t ) tanh ( c ( t ) )
W i   , W f , W c , and W o represent the appropriate weight matrices. The vectors b i ,   b f ,   b c , and b o denote the corresponding bias vectors. The most significant difficulty associated with the LSTM recurrent neural network lies in the process of adjusting its hyperparameters, such as determining the appropriate number of hidden layers, the nodes within each layer, the batch size, the number of epochs, and the learning rate, and optimizing the connection weights, biases of the network, etc. [51].

3.4. RNN Based Gated Recurrent Unit

A variation type of LSTM is the GRU, which was proposed by Cho et al. (2014) [52] to make each recurrent unit adaptively capture the dependencies of different time scales. Similarly to the LSTM unit, the GRU has gating units that modulate the flow of information inside the unit, albeit without having separate memory cells [52]. Figure 4 shows the details of the GRU system.
The diagram illustrates a GRU in which each line represents a complete vector, connecting the output of one node to the input of another node. The light pink circles in the diagram represent mathematical operations, while the yellow boxes denote the neural network layers. The direction of the lines indicates the flow of the contents. It should be noted that the GRU layer is based on the LSTM layer and has a similar equation [54]:
z ( t ) = σ ( W z   · h ( t 1 ) , x ( t ) ) + b z ,
r ( t ) = σ ( W r · h t 1 , x t ) + b r ,
h ~ ( t ) = t a n h ( W h · r ( t ) h ( t 1 ) , x ( t ) ) + b h ,
h ( t ) = 1 z ( t ) h t 1 + z t   h ~ t .
The function of the reset gate is to decide on the combination of the new input and the memory, while the update gate determines the proportion of the memory that should be retained. This gating mechanism is analogous to that used in LSTM as it aims to capture long-term dependencies [55].

4. Electricity Demand Pattern of Dataset

Our study’s scope includes the Thailand metropolitan area, which comprises Pathum Thani, Nonthaburi, and Nakhon, as well as Bangkok and the neighboring provinces. These provinces are linked to an enormous number of enterprises, offices, universities, and industrial parks, all of which increase the overall energy demand. For the period of 1 January 2012 to 31 December 2018, we used half-hourly electrical energy demand data from EGAT (same as [56]) in this paper. Based on meteorological information for the Bangkok metropolitan region, the period of cooling typically spans from March through September, with the highest temperatures and humidity occurring between April and August. Throughout this timeframe, there is a notable rise in electricity usage, primarily for cooling needs such as air conditioning. There is still a noticeable demand for space heating during the cooler period from December to February. Additionally, there is a consistent need for hot water heating throughout the year in both residential and commercial settings to provide warm water [57]. According to electricity usage data, buildings consume roughly 70% of Bangkok’s total demand, which includes residential, business, and institutional areas. The rest (30%) of the city’s electrical consumption comes from the industrial sector, which includes manufacturing and production [58]. From Figure 5, we can see that for the moving average, a rolling window of 365 samples was used to track the data’s consistent fluctuation over time. This plot shows that seasonality influences total demand growth, which follows a linear trend.

4.1. Weekdays, Weekends, and Holidays Patterns

Every year, during holidays and other special occasions, there is a discernible drop in the electricity demand. Figure 6a,b shows that extended holidays like the Songkran holiday in the second week of April and the New Year’s holiday in the first week of January, respectively, have a major effect on demand. But in the case of the New Year holiday, demand has started to decrease from Christmas (December 25th) to the first week of January, as shown in Figure 6b. These effects are important to model and provide a considerable challenge to researchers who want to attain high forecasting accuracy. Furthermore, though they have less of an impact than Songkran and New Year’s, holidays like Makha Bucha Day (February), Visakha Bucha Holiday (May), and Father’s Day (December) also affect swings in electricity demand.

4.2. Monthly, Weekly, and Daily Patterns

The demand value varies each month according to the season and holidays observed, especially during these months. Demand was at its peak during the summer, which runs from March through September, although it was lower in April due to Songkran, a lengthy holiday that fell during the second week of the month. The months of October through February are a little bit cooler than the summer; thus, there is less demand during these months. Figure 7a shows the half-hourly demand pattern for one (the first) week of April 2012, which illustrates that Saturday and Sunday (weekends) have low electricity demand compared to other working days (weekdays) because manufacturing plants, officed, and industrial loads dominate residential demand in our research area. On weekends and holidays, residential demand, driven by human behavior, fluctuates unpredictably, affecting forecasting accuracy. Weekdays show consistent midday and evening demand patterns, unlike weekends and holidays. Late-night and early-morning demand remain consistent across weekdays and weekends (Figure 7b).

4.3. Temperature vs. Demand

Thailand is a tropical nation with higher average temperatures; as such, temperature is the primary factor influencing electricity consumption in Thailand. Figure 8 illustrates the clear correlation between electricity demand and temperature. In summer, higher AC usage boosts electricity demand for cooling, while in winter, lower temperatures lead to a slight decrease in demand.
Temperature’s impact on electricity demand on holidays and non-holidays at midnight and the peak hour are depicted in Figure 9b,c, respectively, where orange dots denote holiday and blue dots denote non-holiday demand. Figure 9c describes how temperature affects demand for both holidays and non-holidays during peak hours (2 pm), where demand varied significantly on holidays during the peak hour period. During working days, there is a sharp and linear demand for electricity. The influence of temperature on peak demand is negligible. This fact confirms the assertion made in article [59] that temperature has a negligible effect on commercial demand. When the temperature falls below 30 °C or rises above 35 °C, there is a significant fluctuation in demand during holidays. Moreover, Figure 9a shows the features of the electrical power consumption at two distinct hours, 2 pm with blue dots and 11 pm with orange dots, where the relationship between peak electricity demand and temperature during these two time periods is compared. In particular, Figure 9a indicates that in comparison to the demand at 2 pm, the demand at 11 pm shows a more linear relationship with temperature. The same linear relationship is illustrated for both holidays and non-holidays at 11 pm in Figure 9b.

5. System Model

This article provides three types of deep learning models with hyperparameter tuning for short-term electrical demand forecasting. The proposed approaches are described in this section and are shown in Figure 10. There are four frameworks into which the suggested methods are classified: data pre-processing, model design with training data, fine tuning and testing, and performance analysis. Data normalization, structural transformation, and removing outliers were part of the preprocessing process of the raw data.
Large values can hinder the deep neural network’s learning and convergence, so feature scaling was used to scale the data in the range of 0 to 1. All three deep learning models are trained using the training dataset. The input data and the associated target values are taught to the model to identify patterns and relationships. To reduce the difference between the predicted and the original target values, the model modifies its internal variables (weights and biases) according to the input data. The validation dataset is used to observe the model’s effectiveness during training and to adjust the hyperparameters. It directs the process of determining the model and helps avoid overfitting. After training is finished, the testing dataset is used to assess how well the model performs on unknown data.

5.1. Data Preparation

EGAT, the largest company in the Thai electricity market, provided the dataset that was applied in this research. EGAT processes 100% of the transmission system and nearly 50% of the generation. The nation is divided into five regions by EGAT, which also maintains separate records of the electric loads [41]. The dataset spans seven years (from 1 January 2012 to 31 December 2018) and contains 122,736 instances of half-hourly electricity demand (in MW). There are additional deterministic, historical load, and interaction variables in the preprocessed data. In the entire dataset, 5 years (from 1 January 2012 to 31 December 2016) were selected as the training dataset, 1 year (from 1 January 2017 to 31 December 2017) as the validation dataset, and the remaining 1 year (from 1 January 2018 to 31 December 2018) as the testing dataset. The dataset was split into three groups, known as scenarios, unlike previous research mentioned in [2] in which [41] they were divided into four groups. Splitting the dataset proved effective in simplifying the modeling and demonstrated a significant accuracy enhancement compared with the related work.
Our available dataset comprised half-hourly (HH) 7-year data with 122,736 instances. Hence, the numbers of training, validation, and test instances for each HH in each scenario were as follows:
  • Scenario 1: all the demand from the whole dataset (everyday demand):
    training = 87,696; validation = 17,520; test = 17,520.
  • Scenario 2: only demand for weekdays (demand without Saturday, Sunday, and other holidays):
    training = 58,848; validation = 11,760; test = 11,808.
  • Scenario 3: only demand for non-working days (demand for weekends and holidays):
    training = 28,848; validation = 5808; test = 5664.

5.2. Forecast Horizon

The EGAT system in Thailand forecasts conditions for 2 pm on the next day, along with 10 to 34 h in advance. Since the EGAT office is not open on weekends, EGAT must forecast up to Monday from Friday. Thailand usually uses data up to 106 h ahead for short-term forecasting, particularly during extended holidays. However, the scope of this study is restricted to forecasting for the following day utilizing data up to 2 pm. Simplifying the model, Figure 11 displays the forecast horizon and lag terms specific to Thailand’s practice. To predict demand on a given day, forecasting begins 10 h in advance, at 2 pm. The variable load1d_cut2pm now represents the historical demand data from HH = 0 to HH = 28 of d−1 (the preceding day) and HH = 29 to HH = 47 of d-2. Likewise, our model incorporates the lagged demand for the next two days, which is denoted by a parameter called load2d_cut2pm.
Adding dummy variables and their relationships has been recommended by earlier research to increase forecasting accuracy. Ramanathan et al. [60] suggested the usage of four types of dummy variables—deterministic, temperature, load, and past errors—and their interactions. The term “deterministic” describes predictable variables, like the day of the week, the month, and the year [60]. The variables were grouped into two categories: deterministic and lagged, as presented in Table 2.

5.3. Hyperparameter Tuning

When creating deep learning models, hyperparameter tuning is an essential step. The configuration parameters that a model is trained on and structured with are called hyperparameters. Hyperparameters, in contrast to parameters, which are discovered from the data during training, are preset before training and direct the learning process. The goal of fine-tuning these hyperparameters is to identify the optimal combination that maximizes the model’s performance [61]. We independently carried out the hyperparameter optimization procedure for every deep network in our experiment. These were the primary hyperparameters:
  • Dropout: This serves as a regularization technique aimed at mitigating overfitting by randomly selecting cells within a layer and nullifying their output based on a specified probability.
  • Number of layers: The neural network’s depth, which represents its number of layers. Deeper networks have the potential to overfit but can also capture more complex patterns. Achieving the proper depth is critical.
  • Epochs: How many times is the neural network used to pass the whole dataset back and forth during training? Epoch determines how frequently the model views the complete dataset. Underfitting may result from a lack of epochs, and overfitting may result from an excess of epochs.
  • Number of neurons in each layer: The quantity of neurons in every network layer regulates the model’s ability to recognize patterns. Underfitting can occur from having too few neurons, while overfitting can occur from having too many.
  • Batch size: The total number of training instances used in a single iteration impacts how quickly and effectively training uses memory. Greater batch sizes may result in quicker training, but they also demand more RAM.
  • Learning rate: The step size while attempting to minimize a loss function at each iteration. The model might overshoot the minimum but converge quickly if the learning rate is high. A low learning rate can cause slow convergence.
  • Lookback period: The lookback period refers to the number of previous time steps that are taken into consideration by the model when generating predictions. The model becomes more complex when the lookback period is extended, but it also enables the model to capture longer-term dependencies and patterns. If the lookback period is too short, the model might miss important temporal relationships.

5.4. Performance Analysis

An essential step in determining a predictive model’s efficacy is performance analysis. In this paper, mean absolute error (MAE) and mean absolute percentage error (MAPE) were used as metrics for performance analysis.
Performance analysis workflow:
  • Model Training: Train three deep learning models using the training dataset.
  • Hyperparameter Tuning: Fine-tune different hyperparameters, which are mentioned in Section 5.3, based on performance metrics (MAE, MAPE) calculated on the validation dataset.
  • Model Evaluation: Evaluate the prediction performance of the completed trained model using the testing dataset.
  • Performance Metrics Calculation:
    Use the trained model to make predictions for energy demand on the testing dataset.
    Calculate MAE and MAPE metrics using the actual demand value of the test dataset and predicted value from a trained model using testing data.
    These metrics give us information about the precision and accuracy of the predictions made by our final model.

5.4.1. Mean Absolute Error (MAE)

One useful key performance indicator (KPI) for evaluating forecast accuracy is the mean absolute error (MAE). To ensure that positive and negative residuals never cancel out, we will compute the residual for each data point using only its absolute value. After that, we compute the mean of each of these residuals. The MAE, which merely calculates the absolute difference between the model’s predictions and the actual demand data, is the most appropriate metric. The residual’s absolute value is utilized, so the under- or overperformance of the model is not displayed. The formal equation of MAE is shown below:
MAE = 1 n t = 1 n y t F t ,
where
n = total number of data points;
y t = actual electricity demand at a time “t”;
F t   = predicted electricity demand at a time “t”;

5.4.2. Mean Absolute Percentage Error (MAPE)

In percentage terms, MAE is equivalent to mean absolute percentage error (MAPE). Like MAE, which represents the mean absolute error generated by your model, MAPE indicates the average deviation between the model’s predictions and their corresponding outputs. A popular metric for assessing forecast accuracy in time series data is called MAPE, which is computed as the average of the absolute percentage (%) errors (APEs) within the predicted and actual values of time series data. The formal equation of MAE is shown below:
MAPE = 1 n t = 1 n y t F t y t 100 % .

6. Results and Analysis

This section provides an outline of the methodology used to empirically determine the hyperparameters for the RNN, RNN-LSTM, and RNN-GRU deep learning models across all three scenarios. We separated the entire dataset into three datasets: training, validation, and testing. This allowed us to fine-tune the model’s hyperparameters and increase its efficacy by separating the training dataset into distinct validation datasets. Throughout the training phase, concurrent validation steps were executed using this validation dataset. To conduct the research, the hyperparameter values listed in Table 3 are utilized.
To test hyperparameters value sets particularly for the RNN, RNN-LSTM, and RNN-GRU models, we have assembled a list for all three scenarios. Initially, we tested the built-in model’s validity and functionality using the parameters listed in Table 3. The set of parameters that produced the lowest validation mean absolute error (MAE) was chosen as the ideal or tuned parameter set after its performance was successfully verified. Tables 4, 6, and 8 show the complete set of parameters for all three scenarios.

6.1. Parameters Tuning for Scenario 1

The electricity demand for the year 2018 is forecasted utilizing the refined parameters illustrated in Table 4 with a dataset size of 105,216 and a test size of 17,520. Compared to the other two RNN-LSTM and RNN models, the RNN-GRU model performed better. We achieved the lowest minimum loss of validation (MAE) of 213.36 MW compared to 221.79 MW and 242.35 MW using the RNN-GRU simulation setup.
Table 4. Sets of parameters for lowest validation loss of Scenario 1.
Table 4. Sets of parameters for lowest validation loss of Scenario 1.
ParametersLSTMGRURNN
Number of hidden layers113
Number of nodes1286464
Epochs364238
Batch size484848
Look back period8 days5 days8 days
Dropout0.150.150.15
Time period484848
Validation loss (MAE)221.79213.36242.35
In Scenario 1, as stated in Table 4, we were able to attain the following outcomes:
  • The LSTM model with nodes = 128, layers = 1, dropout = 0.15, lookback period = 8 days, and epochs = 36 produced the minimal validation loss of 221.79 MW.
  • The GRU model with nodes = 64, layers = 1, dropout = 0.15, lookback period = 5 days, and epochs = 42 obtained the minimal validation loss of 213.36 MW, which was the lowest loss across all three models.
  • The RNN model with nodes = 64, layers = 3, dropout = 0.15, lookback period = 8 days, and epochs = 38 achieved the minimal validation loss of 242.35 MW, which was the highest loss across all three models.
When optimized hyperparameters are used, Table 5 shows that the RNN-GRU model achieved its best performance in terms of both performance metrics (MAE and MAPE) with MAE = 214.79 MW and MAPE = 2.08%.
Table 5. Implementing the optimal parameter settings for day-ahead forecasting using the test dataset of Scenario 1.
Table 5. Implementing the optimal parameter settings for day-ahead forecasting using the test dataset of Scenario 1.
ModelNodesLayersDropoutLookback PeriodEpochsTest
MAE
Test
MAPE (%)
LSTM12810.158 days36224.752.12
GRU6410.155 days42214.792.08
RNN6430.158 days38248.642.28

6.2. Parameters Tuning for Scenario 2

The electricity demand for the year 2018 is forecasted, utilizing the refined parameters illustrated in Table 6 with a dataset size of 70,608 and a test size of 11,808. Compared to the other two RNN-LSTM and RNN models, the RNN-GRU model performed better. We achieved the lowest minimum loss of validation (MAE) of 179 MW compared to 189.87 MW and 195.11 MW using the RNN-GRU simulation setup.
Table 6. Set of parameters for lowest validation loss of Scenario 2.
Table 6. Set of parameters for lowest validation loss of Scenario 2.
ParametersLSTMGRURNN
Number of hidden layers112
Number of nodes1286464
Epochs576151
Batch size484848
Look back period5 days8 days8 days
Dropout0.150.150.2
Time period484848
Validation loss (MAE)189.87179195.11
In Scenario 2, as stated in Table 6, we were able to attain the following outcomes:
  • The LSTM model with nodes = 128, layers = 1, dropout = 0.15, lookback period = 5 days, and epochs = 57 produced the minimal validation loss of 189.87 MW.
  • The GRU model with nodes = 64, layers = 1, dropout = 0.15, lookback period = 8 days, and epochs = 61 obtained the minimal validation loss of 179 MW, which was the lowest loss across all three models.
  • The RNN model with nodes = 64, layers = 2, dropout = 0.2, lookback period = 8 days, and epochs = 51 achieved the minimal validation loss of 195.11 MW. which was the highest loss across all three models.
When optimized hyperparameters are used, Table 7 shows that the RNN-GRU model achieved its best performance in terms of both performance metrics (MAE and MAPE) with MAE = 181.63 MW and MAPE = 1.89%.
Table 7. Implementing the optimal parameter settings for day-ahead forecasting using the test dataset of Scenario 2.
Table 7. Implementing the optimal parameter settings for day-ahead forecasting using the test dataset of Scenario 2.
ModelNodesLayersDropoutLookback PeriodEpochsTest
MAE
Test
MAPE (%)
LSTM12810.155 days57191.571.92
GRU6410.158 days61181.631.89
RNN6420.28 days51201.351.98

6.3. Parameters Tuning for Scenario 3

The electricity demand for the year 2018 is forecasted utilizing the refined parameters illustrated in Table 8 with a dataset size of 34,656 and a test size of 5664. Compared to the other two RNN-GRU and RNN models, the RNN-LSTM model performed better. We achieved the lowest minimum loss of validation (MAE) of 222.07 MW compared to 229.89 MW and 230.57 MW using the RNN-LSTM simulation setup.
Table 8. Set of parameters for lowest validation loss of Scenario 3.
Table 8. Set of parameters for lowest validation loss of Scenario 3.
ParametersLSTMGRURNN
Number of hidden layers121
Number of nodes12864128
Epochs728169
Batch size484848
Look back period8 days8 days5 days
Dropout0.100.1
Time period484848
Validation loss (MAE)222.07229.89230.57
In Scenario 3, as stated in Table 8, we were able to attain the following outcomes:
  • The LSTM model with nodes = 128, layers = 1, dropout = 0.1, lookback period = 8 days, and epochs = 72 produced the minimal validation loss of 222.07 MW which was the lowest loss across all three models.
  • The GRU model with nodes = 64, layers = 2, dropout = 0, lookback period = 8 days, and epochs = 81 obtained the minimal validation loss of 229.89 MW.
  • The RNN model with nodes = 128, layers = 1, dropout = 0.1, lookback period = 5 days, and epochs = 69 achieved the minimal validation loss of 230.57 MW, which was the highest loss across all three models.
When optimized hyperparameters are used, Table 9 shows that the RNN-LSTM model achieved its best performance in terms of both performance metrics (MAE and MAPE) with MAE = 226.76 MW and MAPE = 2.13%.
The results of RNN-LSTM, RNN-GRU, and RNN are presented in Figure 12, Figure 13 and Figure 14, respectively, for Scenario 2 (result of alternative months). In each plot, the actual demand is represented as “Actual”, while the forecasted results are indicated by their respective model names, such as LSTM, GRU, and RNN. From Figure 12, Figure 13 and Figure 14, it is evident that the RNN-GRU model performed the best among all three models in terms of prediction accuracy. Specifically, in the case of the RNN-GRU model depicted in Figure 13, there is underestimation in March, May, and July, while January, September, and November exhibit overestimation. Additionally, the results of all three scenarios using all three models are detailed in Appendix A and Appendix B.

7. Conclusions

Ensuring the equilibrium between electricity production and consumption is crucial for efficient power system operation. Precise load forecasting plays a key role in achieving this balance as it enables the proactive anticipation of fluctuations in both supply and demand, thereby ensuring grid stability. This paper presented three types of deep learning models: RNN-LSTM, RNN-GRU, and RNN. They were each constructed to represent three different scenarios using the same seven-year half-hourly electrical energy demand data from EGAT for STLF. All three models, along with three scenarios, were validated using one year of data to optimize hyperparameters. These tuned parameters were then utilized to day-ahead forecast the demand for the year 2018.
In Scenario 1, the RNN-GRU model exhibited the lowest validation MAE loss. This model utilized a 5-day lookback period with 128 nodes in a single layer. It achieved the lowest test MAE loss of 214.79 MW and MAPE of 2.08%. For Scenario 2, the RNN-GRU model achieved the lowest validation MAE loss using an 8-day lookback period with 64 nodes in a single layer, resulting in a test MAE loss of 181.63 MW and MAPE of 1.89%. Meanwhile, in Scenario 3, the RNN-LSTM model obtained the lowest-validation MAE with an 8-day lookback period with 128 nodes in a single layer. This model yielded a test MAE loss of 226.76 MW and MAPE of 2.13%. Among the obtained results from three different models using three scenarios, Scenario 2 emerges as the most promising, outperforming the other two scenarios. This superiority can be assigned to its exclusive focus on the weekday demand dataset, which exhibits consistent demand patterns. On the other hand, Scenario 1 encompasses the entire dataset, including weekdays, weekends, and holidays, leading to a higher degree of demand pattern non-linearity, which raises prediction errors. Scenario 3, which comprises only weekend and holidays demand data, shows improved results compared to previous research, likely due to the expanded dataset.
These findings suggest the potential for implementing STLF by categorizing datasets into three distinct scenarios. Scenario 2 can effectively forecast electricity demand for weekdays (Monday to Friday), while Scenario 3 proves valuable for forecasting demand during weekends and holidays (Saturday, Sunday, and public holidays), demonstrating enhanced accuracy. We did not utilize additional variables such as solar insolation, air humidity, cloud cover percentage, and daily temperature amplitude (maximum–minimum difference) in our study. However, we may consider incorporating these variables in future research to assess their impact on prediction accuracy.

Author Contributions

Conceptualization and methodology, R.K.S. and C.C.; software, R.K.S.; validation, R.K.S., K.C. and C.C.; formal analysis, C.C.; investigation, K.C.; writing—original draft preparation, R.K.S. and K.C.; writing—review and editing, C.C., K.C. and R.K.S.; visualization, K.C. and R.K.S.; supervision, C.C. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data utilized in this research are accessible upon request from the corresponding author. However, they are not publicly accessible as the dataset for electricity demand in Thailand is not openly available. Consequently, the author must uphold privacy and ethical considerations, preventing their public release.

Acknowledgments

The recipient acknowledges the EFS Scholarship granted by the Sirindhorn International Institute of Technology, Thammasat University. And we extend our heartfelt gratitude to Chawalit Jeenanunta and the EGAT for their invaluable contribution of the essential data utilized in this study.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A. Visualization of Different Three Scenarios

The demand forecasting for the year 2018 was conducted using RNN-LSTM, RNN-GRU, and RNN models across scenarios 1, 2, and 3. In each plot, the actual demand is represented as “Actual”, while the forecasted results are indicated by their respective model names, such as LSTM, GRU, and RNN, as provided below (for alternative months). In Figure A1, which illustrates the predictions for Scenario 3 across all three models, the RNN-LSTM model outperformed the others. However, it displayed underestimation in March and May, while overestimation was observed in September and November. From Figure A2 and Figure A3, representing scenarios 2 and 1 for predictions by all three models, it is apparent that the RNN-GRU model outperformed the other two models in both scenarios. There is underestimation in March and May, while September and November exhibited overestimation in Scenario 2. And we observed underestimation in March and May, while overestimation was observed in July, September, and November in Scenario 1.
Figure A1. Electricity demand (MW) on the y-axis and days on x-axis, utilizing Scenario 3.
Figure A1. Electricity demand (MW) on the y-axis and days on x-axis, utilizing Scenario 3.
Applsci 14 03971 g0a1
Figure A2. Electricity demand (MW) on the y-axis and days on x-axis, utilizing Scenario 2.
Figure A2. Electricity demand (MW) on the y-axis and days on x-axis, utilizing Scenario 2.
Applsci 14 03971 g0a2
Figure A3. Electricity demand (MW) on the y-axis and days on x-axis, utilizing Scenario 1.
Figure A3. Electricity demand (MW) on the y-axis and days on x-axis, utilizing Scenario 1.
Applsci 14 03971 g0a3

Appendix B. Tunning of Hyperparameters for Different Three Scenarios

The hyperparameter selection process for Scenario 1 is detailed in Table A1, presenting RNN-GRU’s superior performance over the other two models. Afterward, a range of parameters was tested for all three models to determine the optimal configuration. The resulting validation and test MAE values for each parameter set are presented in the table below.
Table A1. Parameter variation and corresponding test and validation MAE outcomes for Scenario 1.
Table A1. Parameter variation and corresponding test and validation MAE outcomes for Scenario 1.
ParametersLSTM
Results (MAE)
GRU
Results (MAE)
RNN
Results (MAE)
LayersNodesDropoutLookbackEpochsValidationTestValidationTestValidationTest
11280.15538286.71287.95273.66277.59294.81298.9
1640.15542245.44251.39213.36214.79268.78273.77
1320.15557223.69226.20284.98288.17292.97295.03
11280.2540308.23314.27312.40313.16409.04414.22
1640.2544328.21331.26361.68363.98275.32277.59
1320.2557295.88298.18301.24303.36312.68314.45
2640.15547328.18335.36250.78252.21279.92281.27
2640.2548323.48326.33293.34297.81340.18343.97
2320.15555309.48318.81249.92251.27293.73294.13
2320.2552339.40340.97306.15310.35365.40368.59
3640.15532322.84328.63268.21269.81334.20341.09
3640.2532321.49326.83269.84271.46305.83306.14
3320.15545263.27262.47238.92240.83340.58345.22
3320.2545282.52285.80251.84255.24319.90323.07
11280.15836221.79224.75237.35238.77283.90287.53
1640.15844236.47241.07222.39221.82266.77269.20
1320.15858341.48344.46321.46324.81312.57314.78
11280.2841231.43234.45230.55234.77312.21314.50
1640.2845277.18280.36296.31298.64260.88265.14
1320.2851273.86282.31218.46221.81271.51274.36
2640.15846396.32398.83302.08304.98252.26259.75
2640.2846280.71287.92223.66226.05317.17322.49
2320.15852313.87315.12298.51304.36324.10328.04
2320.2852335.47339.83316.80319.72378.45379.64
3640.15838251.34260.03233.01238.25242.35248.64
3640.2838224.88229.52250.79256.59345.59348.20
3320.15843323.59332.42271.38276.53349.90353.07
3320.2843292.82297.20260.27261.11345.96355.47
The hyperparameter selection process for Scenario 2 is detailed in Table A2, presenting RNN-GRU’s superior performance over the other two models. Afterward, a range of parameters was tested for all three models to determine the optimal configuration. The resulting validation and test MAE values for each parameter set are presented in the table below.
Table A2. Parameter variation and corresponding test and validation MAE outcomes for Scenario 2.
Table A2. Parameter variation and corresponding test and validation MAE outcomes for Scenario 2.
ParametersLSTM
Results (MAE)
GRU
Results (MAE)
RNN
Results (MAE)
LayersNodesDropoutLookbackEpochsValidationTestValidationTestValidationTest
11280.15557189.87191.57203.99207.72220.42224.95
1640.15561213.33218.92284.79287.91236.14240.41
1320.15565241.23238.99251.52257.98312.71323.07
11280.2553225.65229.09221.70223.70276.22281.91
1640.2562287.76293.08333.61336.98248.34250.96
1320.2565220.51216.69290.29295.29346.90354.58
2640.15555214.95217.23223.48227.45246.46249.90
2640.2555245.09248.09264.46269.72306.87310.94
2320.15563255.89259.66237.50239.69275.32277.24
2320.2563238.06240.21241.29245.60260.64263.52
3640.15548290.62297.21262.65270.85395.87397.02
3640.2548280.20286.55262.36261.49361.92366.07
3320.15561304.10307.83365.75370.82373.78377.91
3320.2565323.02330.16319.81312.70259.10261.19
11280.15859212.71213.52225.88228.92275.67278.95
1640.15861241.63244.78179.00181.63219.30223.10
1320.15865288.75294.49315.01319.41343.23346.75
11280.2863217.95219.11189.67192.42193.48198.24
1640.2858254.38256.38264.02267.69260.34263.24
1320.2858272.24276.64290.25293.63332.26335.71
2640.15851212.18215.14205.18209.34268.26273.27
2640.2851264.30268.52215.45220.15195.11201.35
2320.15867279.85283.45257.17261.18306.63308.64
2320.2862251.73253.98225.57229.04264.94267.17
3640.15853255.81267.71238.21245.37289.13291.02
3640.2853305.22307.92313.39315.07392.00396.18
3320.15862359.86362.78324.24328.15388.14392.85
3320.2860202.47208.63194.69197.93288.14292.85
The hyperparameter selection process for Scenario 3 is detailed in Table A3, presenting RNN-LSTM’s superior performance over the other two models. Afterward, a range of parameters was tested for all three models to determine the optimal configuration. The resulting validation and test MAE values for each parameter set are presented in the table below.
Table A3. Parameter variation and corresponding test and validation MAE outcomes for Scenario 3.
Table A3. Parameter variation and corresponding test and validation MAE outcomes for Scenario 3.
ParametersLSTM
Results (MAE)
GRU
Results (MAE)
RNN
Results (MAE)
LayersNodesDropoutLookbackEpochsValidationTestValidationTestValidationTest
11280560249.54250.75294.52297.52350.44358.48
1640586354.42358.20305.87312.25247.93255.79
1320575331.27334.13329.71334.60248.94253.74
11280.1569314.61322.62305.65310.33230.57236.57
1640.1585305.86309.67326.13329.11264.66272.89
1320.1570361.40368.75333.36339.7317.98324.56
2640581342.71348.37308.08311.54297.63300.16
2640.1594314.09326.60300.23308.09271.50275.97
2320588300.57302.18263.75269.30278.90283.16
2320.1585308.54311.42281.57288.34298.12302.87
3640568307.34311.83251.97254.13309.38314.75
3640.1568301.68304.02228.18232.18290.03294.37
3320572298.91300.49298.03305.90265.13271.21
3320.1575270.49283.11236.60242.74239.19243.02
11280878301.39304.55282.2287.95290.72301.53
1640875326.11332.03375.61379.60350.59357.21
1320889303.11310.78308.17314.60255.50260.85
11280.1872222.07226.76262.22267.97236.05239.25
1640.1875260.72265.18322.06325.50298.49305.12
1320.1881305.12307.46349.20352.27296.19302.84
2640881259.75267.00229.89231.00321.70323.51
2640.1881287.52288.77267.16272.22319.54322.49
2320887258.13263.77255.08261.69280.17283.86
2320.1879310.64312.41313.43317.52253.92258.11
3640868271.35279.64288.21293.45310.36314.98
3640.1870370.90373.40360.51362.58374.57376.00
3320859295.83304.04319.13323.66307.67312.24
3320.1859368.19380.55360.07361.88340.03343.33

References

  1. Ramos, P.V.B.; Villela, S.M.; Silva, W.N.; Dias, B.H. Residential energy consumption forecasting using deep learning models. Appl. Energy 2023, 350, 121705. [Google Scholar] [CrossRef]
  2. Chapagain, K.; Kittipiyakul, S.; Kulthanavit, P. Short-term electricity demand forecasting: Impact analysis of temperature for Thailand. Energies 2020, 13, 2498. [Google Scholar] [CrossRef]
  3. Koprinska, I.; Rana, M.; Agelidis, V.G. Correlation and instance based feature selection for electricity load forecasting. Knowl. -Based Syst. 2015, 82, 29–40. [Google Scholar] [CrossRef]
  4. Shin, S.M.; Rasheed, A.; Kil-Heum, P.; Veluvolu, K.C. Fast and Accurate Short-Term Load Forecasting with a Hybrid Model. Electronics 2024, 13, 1079. [Google Scholar] [CrossRef]
  5. Nti, I.K.; Teimeh, M.; Nyarko-Boateng, O.; Adekoya, A.F. Electricity load forecasting: A systematic review. J. Electr. Syst. Inf. Technol. 2020, 7, 13. [Google Scholar] [CrossRef]
  6. Ding, Y.; Zhu, Y.; Feng, J.; Zhang, P.; Cheng, Z. Interpretable spatio-temporal attention LSTM model for flood forecasting. Neurocomputing 2020, 403, 348–359. [Google Scholar] [CrossRef]
  7. Li, L.-L.; Zhao, X.; Tseng, M.-L.; Tan, R.R. Short-term wind power forecasting based on support vector machine with improved dragonfly algorithm. J. Clean. Prod. 2020, 242, 118447. [Google Scholar] [CrossRef]
  8. Carvalho, T.P.; Soares, F.A.; Vita, R.; Francisco, R.d.P.; Basto, J.P.; Alcalá, S.G. A systematic literature review of machine learning methods applied to predictive maintenance. Comput. Ind. Eng. 2019, 137, 106024. [Google Scholar] [CrossRef]
  9. Chapagain, K.; Kittipiyakul, S. Performance Analysis of Short-Term Electricity Demand with Atmospheric Variables. Energies 2018, 11, 818. [Google Scholar] [CrossRef]
  10. Lusis, P.; Khalilpour, K.R.; Andrew, L.; Liebman, A. Short-term residential load forecasting: Impact of calendar effects and forecast granularity. Appl. Energy 2017, 205, 654–669. [Google Scholar] [CrossRef]
  11. Papalexopoulos, A.D.; Hesterberg, T.C. A regression-based approach to short-term system load forecasting. IEEE Trans. Power Syst. 1990, 5, 1535–1547. [Google Scholar] [CrossRef]
  12. Hammad, M.A.; Jereb, B.; Rosi, B.; Dragan, D. Methods and models for electric load forecasting: A comprehensive review. Logist. Sustain. Transp. 2020, 11, 51–76. [Google Scholar] [CrossRef]
  13. Zuo, C.; Wang, J.; Liu, M.; Deng, S.; Wang, Q. An ensemble framework for short-term load forecasting based on timesnet and tcn. Energies 2023, 16, 5330. [Google Scholar] [CrossRef]
  14. Waheed, W.; Xu, Q. Optimal short term power load forecasting algorithm by using improved artificial intelligence technique. In Proceedings of the 2020 2nd International Conference on Computer and Information Sciences (ICCIS), Sakaka, Saudi Arabia, 13–15 October 2020; pp. 1–4. [Google Scholar]
  15. Akhtar, S.; Shahzad, S.; Zaheer, A.; Ullah, H.S.; Kilic, H.; Gono, R.; Jasiński, M.; Leonowicz, Z. Short-term load forecasting models: A review of challenges, progress, and the road ahead. Energies 2023, 16, 4060. [Google Scholar] [CrossRef]
  16. Son, N. Comparison of the deep learning performance for short-term power load forecasting. Sustainability 2021, 13, 12493. [Google Scholar] [CrossRef]
  17. Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef] [PubMed]
  18. Fiot, J.-B.; Dinuzzo, F. Electricity demand forecasting by multi-task learning. IEEE Trans. Smart Grid 2016, 9, 544–551. [Google Scholar] [CrossRef]
  19. Dudek, G. Pattern-based local linear regression models for short-term load forecasting. Electr. Power Syst. Res. 2016, 130, 139–147. [Google Scholar] [CrossRef]
  20. Ismail, Z.; Jamaluddin, F.; Jamaludin, F. Time series regression model for forecasting Malaysian electricity load demand. Asian J. Math. Stat. 2008, 1, 139–149. [Google Scholar] [CrossRef]
  21. Zhang, G.; Guo, J. A novel method for hourly electricity demand forecasting. IEEE Trans. Power Syst. 2019, 35, 1351–1363. [Google Scholar] [CrossRef]
  22. Khwaja, A.; Zhang, X.; Anpalagan, A.; Venkatesh, B. Boosted neural networks for improved short-term electric load forecasting. Electr. Power Syst. Res. 2017, 143, 431–437. [Google Scholar] [CrossRef]
  23. Khwaja, A.S.; Anpalagan, A.; Naeem, M.; Venkatesh, B. Joint bagged-boosted artificial neural networks: Using ensemble machine learning to improve short-term electricity load forecasting. Electr. Power Syst. Res. 2020, 179, 106080. [Google Scholar] [CrossRef]
  24. Bouktif, S.; Fiaz, A.; Ouni, A.; Serhani, M.A. Multi-sequence LSTM-RNN deep learning and metaheuristics for electric load forecasting. Energies 2020, 13, 391. [Google Scholar] [CrossRef]
  25. Bouktif, S.; Fiaz, A.; Ouni, A.; Serhani, M.A. Optimal deep learning lstm model for electric load forecasting using feature selection and genetic algorithm: Comparison with machine learning approaches. Energies 2018, 11, 1636. [Google Scholar] [CrossRef]
  26. Chen, K.; Chen, K.; Wang, Q.; He, Z.; Hu, J.; He, J. Short-term load forecasting with deep residual networks. IEEE Trans. Smart Grid 2018, 10, 3943–3952. [Google Scholar] [CrossRef]
  27. Din, G.M.U.; Marnerides, A.K. Short term power load forecasting using deep neural networks. In Proceedings of the 2017 International Conference on Computing, Networking and Communications (ICNC), Silicon Valley, CA, USA, 26–29 January 2017; pp. 594–598. [Google Scholar]
  28. Li, Y.; Pizer, W.A.; Wu, L. Climate change and residential electricity consumption in the Yangtze River Delta, China. Proc. Natl. Acad. Sci. USA 2019, 116, 472–477. [Google Scholar] [CrossRef] [PubMed]
  29. Stošović, M.A.; Radivojević, N.; Ivanova, M. Electricity Consumption Prediction in an Electronic System Using Artificial Neural Networks. Electronics 2022, 11, 3506. [Google Scholar] [CrossRef]
  30. Xiao, L.; Wang, J.; Yang, X.; Xiao, L. A hybrid model based on data preprocessing for electrical power forecasting. International J. Electr. Power Energy Syst. 2015, 64, 311–327. [Google Scholar] [CrossRef]
  31. Phuangpornpitak, N.; Prommee, W. A study of load demand forecasting models in electric power system operation and planning. GMSARN Int. J. 2016, 10, 19–24. [Google Scholar]
  32. Gao, J.; Chen, Y.; Hu, W.; Zhang, D. An adaptive deep-learning load forecasting framework by integrating transformer and domain knowledge. Adv. Appl. Energy 2023, 10, 100142. [Google Scholar] [CrossRef]
  33. Fotopoulou, M.C.; Drosatos, P.; Petridis, S.; Rakopoulos, D.; Stergiopoulos, F.; Nikolopoulos, N. Model predictive control for the energy Management in a District of buildings equipped with building integrated photovoltaic systems and batteries. Energies 2021, 14, 3369. [Google Scholar] [CrossRef]
  34. Hesselmann, F.; Zhu, C.C.; Köppen-Seliger, B.; Ding, S.X. Model Predictive Control Based Energy Flow Control in the Smart Grid. In Proceedings of the 15th European Workshop on Advanced Control and Diagnosis, Bologna, Italy, 21–22 November 2019; pp. 657–677. [Google Scholar]
  35. Chapagain, K.; Kittipiyakul, S. Short-term electricity load forecasting for Thailand. In Proceedings of the 2018 15th International Conference on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology (ECTI-CON), Chiang Rai, Thailand, 18–21 July 2018; pp. 521–524. [Google Scholar]
  36. Dilhani, M.S.; Jeenanunta, C. Daily electric load forecasting: Case of Thailand. In Proceedings of the 2016 7th International Conference of Information and Communication Technology for Embedded Systems (IC-ICTES), Bangkok, Thailand, 20–22 March 2016; pp. 25–29. [Google Scholar]
  37. Chapagain, K.; Kittipiyakul, S. Short-term electricity demand forecasting with seasonal and interactions of variables for thailand. In Proceedings of the 2018 International Electrical Engineering Congress (iEECON), Krabi, Thailand, 7–9 March 2018; pp. 1–4. [Google Scholar]
  38. Jeenanunta, C.; Abeyrathn, K.D. Combine particle swarm optimization with artificial neural networks for short-term load forecasting. Int. Sci. J. Eng. Technol. (ISJET) 2017, 1, 25–30. [Google Scholar]
  39. Chapagain, K.; Kittipiyakul, S. Short-term electricity load forecasting model and Bayesian estimation for Thailand data. In Proceedings of the MATEC Web of Conferences 2016 Asia Conference on Power and Electrical Engineering (ACPEE 2016), Bangkok, Thailand, 20–22 March 2016; p. 06003. [Google Scholar]
  40. Chapagain, K.; Soto, T.; Kittipiyakul, S. Improvement of performance of short term electricity demand model with meteorological parameters. Kathford J. Eng. Manag. 2018, 1, 15–22. [Google Scholar] [CrossRef]
  41. Sankalpa, C.; Kittipiyakul, S.; Laitrakun, S. Forecasting Short-Term Electricity Load Using Validated Ensemble Learning. Energies 2022, 15, 8567. [Google Scholar] [CrossRef]
  42. Abeyrathna, K.D.; Jeenanunta, C. Hybrid particle swarm optimization with genetic algorithm to train artificial neural networks for short-term load forecasting. Int. J. Swarm Intell. Res. (IJSIR) 2019, 10, 1–14. [Google Scholar] [CrossRef]
  43. Alotaibi, M.A. Machine learning approach for short-term load forecasting using deep neural network. Energies 2022, 15, 6261. [Google Scholar] [CrossRef]
  44. Williams, R.J.; Zipser, D. A learning algorithm for continually running fully recurrent neural networks. Neural Comput. 1989, 1, 270–280. [Google Scholar] [CrossRef]
  45. Salem, F.M. A basic recurrent neural network model. arXiv 2016, arXiv:1612.09022. [Google Scholar]
  46. Shi, H.; Xu, M.; Li, R. Deep learning for household load forecasting—A novel pooling deep RNN. IEEE Trans. Smart Grid 2017, 9, 5271–5280. [Google Scholar] [CrossRef]
  47. Arslan, S. A hybrid forecasting model using LSTM and Prophet for energy consumption with decomposition of time series data. PeerJ Comput. Sci. 2022, 8, e1001. [Google Scholar] [CrossRef] [PubMed]
  48. Dhake, H.; Kashyap, Y.; Kosmopoulos, P. Algorithms for hyperparameter tuning of lstms for time series forecasting. Remote Sens. 2023, 15, 2076. [Google Scholar] [CrossRef]
  49. Zheng, H.; Yuan, J.; Chen, L. Short-term load forecasting using EMD-LSTM neural networks with a Xgboost algorithm for feature importance evaluation. Energies 2017, 10, 1168. [Google Scholar] [CrossRef]
  50. Tang, H.; Ling, X.; Li, L.; Xiong, L.; Yao, Y.; Huang, X. One-shot pruning of gated recurrent unit neural network by sensitivity for time-series prediction. Neurocomputing 2022, 512, 15–24. [Google Scholar] [CrossRef]
  51. Kumar, G.; Singh, U.P.; Jain, S. An adaptive particle swarm optimization-based hybrid long short-term memory model for stock price time series forecasting. Soft Comput. 2022, 26, 12115–12135. [Google Scholar] [CrossRef] [PubMed]
  52. Cho, K.; Van Merriënboer, B.; Gulcehre, C.; Bahdanau, D.; Bougares, F.; Schwenk, H.; Bengio, Y. Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv 2014, arXiv:1406.1078. [Google Scholar]
  53. Chung, J.; Gulcehre, C.; Cho, K.; Bengio, Y. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv 2014, arXiv:1412.3555. [Google Scholar]
  54. Li, W.; Logenthiran, T.; Woo, W.L. Multi-GRU prediction system for electricity generation’s planning and operation. IET Gener. Transm. Distrib. 2019, 13, 1630–1637. [Google Scholar] [CrossRef]
  55. Lynn, H.M.; Pan, S.B.; Kim, P. A deep bidirectional GRU network model for biometric electrocardiogram classification based on recurrent neural networks. IEEE Access 2019, 7, 145395–145405. [Google Scholar] [CrossRef]
  56. Shiwakoti, R.K.; Charoenlarpnopparut, C.; Chapagain, K. Time Series Analysis of Electricity Demand Forecasting Using Seasonal ARIMA and an Exponential Smoothing Model. In Proceedings of the 2023 International Conference on Power and Renewable Energy Engineering (PREE), Tokyo, Japan, 20–22 October 2023; pp. 131–137. [Google Scholar]
  57. Chungloo, S.; Limmeechokchai, B. Application of passive cooling systems in the hot and humid climate: The case study of solar chimney and wetted roof in Thailand. Build. Environ. 2007, 42, 3341–3351. [Google Scholar] [CrossRef]
  58. Nguyen, C.T.; Nguyen, D.T.H.; Phan, D.K. Factors affecting urban electricity consumption: A case study in the Bangkok Metropolitan Area using an integrated approach of earth observation data and data analysis. Environ. Sci. Pollut. Res. 2021, 28, 12056–12066. [Google Scholar] [CrossRef]
  59. Chapagain, K.; Gurung, S.; Kulthanavit, P.; Kittipiyakul, S. Short-term electricity demand forecasting using deep neural networks: An analysis for Thai data. Appl. Syst. Innov. 2023, 6, 100. [Google Scholar] [CrossRef]
  60. Ramanathan, R.; Engle, R.; Granger, C.W.; Vahid-Araghi, F.; Brace, C. Short-run forecasts of electricity loads and peaks. Int. J. Forecast. 1997, 13, 161–174. [Google Scholar] [CrossRef]
  61. Wang, S.; Ma, C.; Xu, Y.; Wang, J.; Wu, W. A hyperparameter optimization algorithm for the LSTM temperature prediction model in data center. Sci. Program. 2022, 2022, 6519909. [Google Scholar] [CrossRef]
Figure 1. Structure of the deep neural network.
Figure 1. Structure of the deep neural network.
Applsci 14 03971 g001
Figure 2. Unfold architecture of N-layer RNN [46].
Figure 2. Unfold architecture of N-layer RNN [46].
Applsci 14 03971 g002
Figure 3. The architecture of LSTM memory block [50].
Figure 3. The architecture of LSTM memory block [50].
Applsci 14 03971 g003
Figure 4. The architecture of the GRU memory block [53].
Figure 4. The architecture of the GRU memory block [53].
Applsci 14 03971 g004
Figure 5. Seven years’ overall half-hourly demand profile.
Figure 5. Seven years’ overall half-hourly demand profile.
Applsci 14 03971 g005
Figure 6. (a) Demand profile of weekdays, weekends, and holidays for April 2014; (b) demand profile of weekdays, weekends, and holidays for December 2012 to 4 January 2013.
Figure 6. (a) Demand profile of weekdays, weekends, and holidays for April 2014; (b) demand profile of weekdays, weekends, and holidays for December 2012 to 4 January 2013.
Applsci 14 03971 g006
Figure 7. (a) Daily demand for one-week; (b) Average demand profile for weekday, weekend, and holiday patterns for 7 years.
Figure 7. (a) Daily demand for one-week; (b) Average demand profile for weekday, weekend, and holiday patterns for 7 years.
Applsci 14 03971 g007
Figure 8. Correlation between temperature and electricity demand for the second week of March 2018.
Figure 8. Correlation between temperature and electricity demand for the second week of March 2018.
Applsci 14 03971 g008
Figure 9. (a) Effect of temperature at two different hours (2 pm and 11 pm); (b) effect of temperature during midnight (11 pm); and (c) effect of temperature during the peak hour (2 pm).
Figure 9. (a) Effect of temperature at two different hours (2 pm and 11 pm); (b) effect of temperature during midnight (11 pm); and (c) effect of temperature during the peak hour (2 pm).
Applsci 14 03971 g009
Figure 10. Proposed electrical demand forecasting methodology.
Figure 10. Proposed electrical demand forecasting methodology.
Applsci 14 03971 g010
Figure 11. Demand forecast horizon: the practice of EGAT in Thailand [59].
Figure 11. Demand forecast horizon: the practice of EGAT in Thailand [59].
Applsci 14 03971 g011
Figure 12. Electricity demand (MW) on the y-axis and days on the x-axis using RNN-LSTM.
Figure 12. Electricity demand (MW) on the y-axis and days on the x-axis using RNN-LSTM.
Applsci 14 03971 g012
Figure 13. Electricity demand (MW) on the y-axis and days on the x-axis using RNN-GRU.
Figure 13. Electricity demand (MW) on the y-axis and days on the x-axis using RNN-GRU.
Applsci 14 03971 g013
Figure 14. Electricity demand (MW) on the y-axis and days on the x-axis using RNN.
Figure 14. Electricity demand (MW) on the y-axis and days on the x-axis using RNN.
Applsci 14 03971 g014
Table 1. List of articles that were published using the EGAT dataset [41].
Table 1. List of articles that were published using the EGAT dataset [41].
DatasetMethodsResultsMAPEReferences
2009–2013OLSThe model’s prediction accuracy has increased with the inclusion of interaction variables.>4%[37]
2009–2013OLS and Bayesian estimationThe forecast accuracy has increased by 20% because of the model’s adding a temperature variable.2% to 3%[35]
2009–2013OLS, GLSAR, FF-ANNCompared to FF-ANN, OLS, and GLSAR, models exhibited greater forecasting accuracy.1.74% to 2.95%[2]
2009–2013MLR with AR (2)In comparison to OLS estimation, Bayesian estimation offers better and more reliable results.1% to 5%[39]
2009–2013Ensemble for regression and MLIt reduces the test MAPE when implementing the blocked cross validation method.2.6%[41]
2013PSO with ANNTo train the ANN for STLF, PSO outperformed the backpropagation training technique.3.44%[19]
2013PSO + GA with ANNThe backpropagation and PSO training algorithms are outperformed by PSO + GA.>3%[42]
2013ANNThe model’s prediction accuracy has increased with the addition of a temperature variable.3.27% to 4.61%[36]
Table 2. List of selected input variables [59].
Table 2. List of selected input variables [59].
TypesVariablesDescription
DeterministicWDWeekday dummy (Mon, Tue, …, Sat, Sun)
MDMonth dummy (Jan, Feb, …………, Nov, Dec)
HolidayBinary 0 or 1
Day After HolidayBinary 0 or 1
Day After long HolidayBinary 0 or 1
Holiday TypeType of holiday (Songkran, Newyear, ………, etc.)
LaggedLoad1d_cut2pm1 day ahead until 2 pm and 2 days ahead after 2 pm load
Load2d_cut2pm2 days ahead until 2 pm and 3 days ahead after 2 pm load
Load3d_cut2pmR3 days ahead until 2 pm and 4 days ahead after 2 pm load
Load4d_cut2pmR4 days ahead until 2 pm and 5 days ahead after 2 pm load
TemperatureTempForecasted temperature
MaxTempMaximum forecasted temperature
Square temperatureSquare of the forecasted temperature
MA2pmTempMoving average of temperature at 2 pm
InteractionWD: TempInteraction of weekday dummy to temperature
MD: TempInteraction of month dummy to temperature
Table 3. Sets of hyperparameters for all three scenarios.
Table 3. Sets of hyperparameters for all three scenarios.
ParametersValues
Number of hidden layers[1, 2, 3]
No of nodes[2, 4, 8, 16, 32, 64, 128]
Look back period[5 days and 8 days]
Dropout[0, 0.1, 0.15, 0.2]
Epochs[up to 1 million]
Table 9. Implementing the optimal parameter settings for day-ahead forecasting using the test dataset of Scenario 3.
Table 9. Implementing the optimal parameter settings for day-ahead forecasting using the test dataset of Scenario 3.
ModelNodesLayersDropoutLookback PeriodEpochsTest
MAE
Test
MAPE (%)
LSTM12810.18 days72226.762.13
GRU64208 days812312.19
RNN12810.15 days69236.572.22
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Shiwakoti, R.K.; Charoenlarpnopparut, C.; Chapagain, K. A Deep Learning Approach for Short-Term Electricity Demand Forecasting: Analysis of Thailand Data. Appl. Sci. 2024, 14, 3971. https://doi.org/10.3390/app14103971

AMA Style

Shiwakoti RK, Charoenlarpnopparut C, Chapagain K. A Deep Learning Approach for Short-Term Electricity Demand Forecasting: Analysis of Thailand Data. Applied Sciences. 2024; 14(10):3971. https://doi.org/10.3390/app14103971

Chicago/Turabian Style

Shiwakoti, Ranju Kumari, Chalie Charoenlarpnopparut, and Kamal Chapagain. 2024. "A Deep Learning Approach for Short-Term Electricity Demand Forecasting: Analysis of Thailand Data" Applied Sciences 14, no. 10: 3971. https://doi.org/10.3390/app14103971

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop