Long Short-Term Memory vs Gated Recurrent Unit: A Literature Review on the Performance of Deep Learning Methods in Temperature Time Series Forecasting
International Journal of Robotics and Control Systems Vol. 4 No. 3 (2024) 1506-1526
Abstract
Temperature forecasting is a crucial aspect of meteorology and climate change studies, but challenges arise due to the complexity of time series data involving seasonal patterns and long-term trends. Traditional methods often fall short in handling this variability, necessitating more advanced solutions to enhance prediction accuracy. LSTM and GRU models have emerged as promising alternatives for modeling temperature data. This study is a literature review comparing the effectiveness of LSTM and GRU based on previous research in temperature forecasting. The goal of this review is to evaluate the performance of both models using various evaluation metrics such as MSE, RMSE, and MAE to identify gaps in previous research and suggest improvements for future studies. The method involves a comprehensive analysis of previous studies using LSTM and GRU for temperature forecasting. Assessment is based on RMSE values and other metrics to compare the accuracy and consistency of both models across different conditions and temperature datasets. The analysis results show that LSTM has an RMSE range of 0.37 to 2.28. While LSTM demonstrates good performance in handling long-term dependencies, GRU provides more stable and accurate performance with an RMSE range of 0.03 to 2.00. This review underscores the importance of selecting the appropriate model based on data characteristics to improve the reliability of temperature forecasting.
1.Introduction
Forecasting air temperature is a crucial task in various fields, including weather prediction, climate science, and environmental monitoring, with significant impacts on many sectors [1]-[5]. Accurate temperature forecasting can provide invaluable information for sectors such as agriculture, where precise temperature conditions can influence crop yields and management strategies [6]-[8]; energy, where accurate temperature predictions can assist in planning energy consumption and optimizing resource use [9]-[11]; and public safety, where accurate temperature information enables better preparation for extreme weather events like heatwaves or cold spells that can impact public health [12], [13]. With the increasing frequency and intensity of extreme weather events due to climate change, the need for more accurate temperature forecasting becomes even more critical. Inaccuracies in forecasting can lead to significant consequences, such as economic losses and safety risks.
Temperature forecasting often faces significant challenges because temperature data exhibits highly complex and nonlinear patterns [14]-[17]. Variable seasonal patterns and unstable long-term trends make traditional forecasting models often ineffective at capturing these dynamics. Extreme weather events or global climate changes can cause unexpected fluctuations and patterns that are difficult to predict using standard methods. This results in conventional methods often failing to provide accurate and reliable predictions [18], thus necessitating more sophisticated approaches to handle the complexity and variability of temperature data more effectively. Therefore, research and development of more effective temperature forecasting methods are essential to enhance the ability to anticipate and respond to these challenges better, one of which is by applying deep learning methods.
Recurrent Neural Networks (RNNs) are a deep learning method that has emerged as a powerful tool for sequence prediction problems due to their ability to process and learn from time series data [19]-[22]. Among the various types of RNNs, Long Short-Term Memory (LSTM) and Gated Recurrent Units (GRU) have gained particular attention [23]. These models are designed to overcome the limitations of standard RNNs, such as the vanishing gradient problem, which hinders learning in long sequences [24]-[27]. By incorporating mechanisms to retain information over long periods, LSTM and GRU models are well-suited for tasks involving temporal dependencies. LSTM, introduced by Hochreiter and Schmidhuber in 1997, uses memory cells and three types of gates (input, forget, and output) to regulate the flow of information [28]-[31]. This structure allows LSTM to maintain long-term dependencies and model complex temporal patterns effectively. Meanwhile, GRU, proposed by Cho et al. in 2014, offers a simpler version by combining the input and forget gates into a single update gate and merging the cell state with the hidden state [32]-[35]. This simplification reduces computational complexity and training time while retaining the capability to capture dependencies in sequential data.
Many studies have applied LSTM and GRU in the context of temperature forecasting [36]-[47]. However, the choice between these two models often depends on factors such as dataset characteristics, model complexity, and computational efficiency. Some research suggests that LSTM has an advantage in capturing more complex long-term dependencies, while GRU excels in training speed and memory efficiency. Researchers have also found instances where the superiority of each method is uncertain. In some cases, LSTM provides better results, while in others, GRU performs better, even with the same model parameters and complexity. Hence, researchers aim to review this in a more specific context, namely temperature forecasting.
Although there are numerous studies comparing LSTM and GRU, there is no comprehensive review specifically addressing the comparison of these models in the context of temperature forecasting. This review is crucial to highlight the strengths and weaknesses of each model and provide insights into the suitability of each model for various forecasting scenarios within this context. The objective of this literature review is to provide a detailed examination of the performance of LSTM and GRU models in temperature forecasting. The contribution of this research is to offer a comparative performance analysis of the LSTM and GRU methods by considering various studies and case examples in temperature forecasting. Additionally, this research aims to identify gaps in previous studies and suggest potential future research directions related to temperature forecasting.
2.Basic Concept of DL Method
2.1.LSTM
LSTM is a variant of designed to overcome the main limitation of standard RNNs, which is their inability to handle long-term dependencies in sequential data [48]-[51]. The core strength of LSTM lies in its ability to retain information for long periods without fading, which is crucial in applications such as text processing, speech recognition, signal processing, and time series data. In regular RNNs, information flows from one time step to the next, allowing the network to learn patterns in data sequences. However, when the gap between relevant information in the input and the time the network needs to learn it becomes too large, the gradients during the training process significantly diminish (the vanishing gradient problem). This makes it difficult for RNNs to remember information from distant time steps. LSTM solves this problem by introducing a gated mechanism that intelligently controls which information should be stored or forgotten. Each LSTM unit consists of several key components: a cell state, hidden state, and three main gates: the forget gate, input gate, and output gate [52]-[56]. The cell state acts as long-term memory, which can be modified by these gates. Essentially, LSTM functions by selecting which relevant information should be stored in the cell state and which should be discarded.
The forget gate is used to determine which information from the previous cell state should be forgotten. This process combines information from the previous hidden state and the current input , which is then passed through a sigmoid activation function . The sigmoid function outputs a value between 0 and 1, meaning the forget gate can gradually choose between retaining all (value 1) or forgetting all (value 0) information from the cell state. The forget gate equation is represented in Equation (1). The input gate is responsible for deciding how much new information will be added to the cell state. Like the forget gate, the input gate uses a sigmoid function to regulate how much of the current input and the previous hidden state will influence the cell state. The input gate is shown in Equation (2) [57]-[59]. On the other hand, the candidate cell state value is generated using the tanh activation function, which outputs values between -1 and 1 (Equation (3)). This candidate cell state represents the potential new changes that will be added to the cell state after being regulated by the input gate. In other words, it is the draft of the new cell state that will be updated, and this candidate can be largely relevant or completely ignored, depending on the output of the input gate.
The cell state is updated based on two components. The first component is the product of the forget gate and the previous cell state . This ensures that important information from the previous cell state remains. The second component is the product of the input gate and the candidate cell state , which represents the new information to be added to the cell state (Equation (4)). Next, the output gate regulates which part of the cell state will be used as the output or hidden state . A combination of the current input and the previous hidden state is passed through a sigmoid function to decide which part of the relevant information will be forwarded as output (Equation (5)). After the output gate determines which part of the cell state will be passed on, the hidden state is calculated by multiplying the output gate by the updated cell state , which is passed through the tanh activation function (Equation (6)). The tanh function is used to constrain the hidden state values between -1 and 1, allowing control over the flow of information. The LSTM architecture is illustrated in Fig. 1 [60]-[63].
2.2.GRU
A GRU is a type of artificial neural network that falls under the category of RNNs [64], [65]. GRU was introduced to address some of the limitations of traditional RNNs, particularly the vanishing gradient problem that often occurs when processing long sequences of data. GRU uses gating mechanisms to help control the flow of information and memory within the network. This allows GRU to retain important information from previous data sequences while forgetting less relevant information. The key benefit of a GRU compared to an LSTM is its more streamlined design, which allows for quicker training times and reduced computational complexity because it involves fewer parameters [66]-[69]. GRU operates using two main gates: the update gate and the reset gate, which are represented in Equations (7) and (8), respectively [70]-[73].
The update gate is responsible for determining how much information from the past should be passed on to the current state. The sigmoid function is used to ensure the value is between 0 and 1 [74]. This value is multiplied by the weight and combined with the previous hidden state and the current input . The update gate allows the network to decide how much new information needs to be integrated with the old information. On the other hand, the reset gate controls how much of the previous information should be forgotten. By using the sigmoid function , the value of is also between 0 and 1. The weight , the previous hidden state , and the current input are combined to determine the value of the reset gate. The reset gate allows the network to forget old information that is no longer relevant in the context of the current data sequence. Besides the update gate and the reset gate, there is also the candidate memory state and the current hidden state , which are represented in Equations (9) and (10), respectively [70]-[73].
The candidate memory is calculated by first multiplying the reset gate with the previous hidden state , then adding the current input , and finally applying the tanh activation function. The tanh function is used to produce values between -1 and 1, which serve as the new candidate for the current hidden state. This candidate memory reflects the new information proposed to be integrated into the hidden state. The hidden state is a combination of the previous hidden state modulated by the update gate and the new candidate memory . The update gate determines the proportion of old and new memory to be combined. If approaches 1, the new memory becomes more dominant, while if approaches 0, the previous hidden state remains more dominant. This combination allows the GRU to adaptively remember or forget information based on the context of the received data. The GRU architecture is shown in Fig. 2 [75], [76].
3.Datasets
The datasets used in this temperature and meteorological analysis can come from various sources that provide information about weather conditions in different locations and periods. Data from international and national meteorological agencies provide information about temperature and other atmospheric parameters that are crucial for studies on climate change and global and regional weather patterns. Local meteorological stations, such as BMKG in Indonesia, supply daily temperature data that support climate trend analysis in specific areas [77]-[80]. Sources such as automated weather observation systems at specific locations, like airports, provide detailed data on local weather conditions and can be used and developed for weather forecasting for airline operations. Additionally, open data platforms like Kaggle offer historical datasets that can be used for scientific research [81]-[84].
Self-collected temperature data can also be used as a dataset for weather forecasting. However, to ensure accurate forecasting, make sure the measuring instruments are calibrated to ensure data accuracy. If the data comes from external sources, ensure the dataset is from a reliable source and not manipulated to maintain data integrity. This will also help the model to learn the true patterns in the data without any manipulation. A significant challenge with meteorological datasets is that they often have a considerable number of missing values. Therefore, it is essential to address this issue properly to ensure that the presence of missing values does not compromise data integrity, allowing the model to be trained effectively.
4.Evaluation Metrics
In evaluating the performance of forecasting models, three metrics are commonly used: Mean Squared Error (MSE) [85]-[88], Root Mean Squared Error (RMSE) [89]-[92], and Mean Absolute Error (MAE) [93]-[95]. MSE is a measure that calculates the average squared difference between observed values and expected values [96], [97]. In the context of prediction or forecasting, MSE is a measure that calculates the average of the squared differences between predicted values and actual values. MSE provides a larger penalty for larger errors because squaring the errors gives more weight to larger deviations (Equation (11)) [98], [99]. On the other hand, RMSE is the square root of MSE and provides an error measure in the same units as the original data (Equation (12)) [100]-[102]. In this literature review, RMSE will be used to compare the performance of LSTM and GRU based on previous research. The RMSE values from one study will be compared with those from other studies to identify the more powerful and reliable method for future temperature forecasting. In addition to MSE and RMSE, there is MAE, which calculates the average of the absolute differences between predicted values and actual values (Equation (13)). MAE provides a clear indication of the average prediction error without amplifying the impact of larger errors, as MSE and RMSE do.
5.Results and Discussion
5.1.Previous Research on Forecasting with LSTM and GRU
In the world of temperature prediction modeling, various methods and techniques have been developed to improve the accuracy and efficiency of weather forecasts. Among these techniques, LSTM and GRU have become two popular methods due to their ability to handle time series data and model complex seasonal patterns or trends. Many studies have attempted to apply LSTM and GRU methods to weather forecasting, particularly temperature forecasting, to improve prediction accuracy in the context of time series with dynamic and seasonal characteristics. As variants of RNN, LSTM and GRU have shown potential in addressing challenges associated with temporal data. Researchers have been applying these methods to temperature forecasting and exploring potential areas for future development over the years.
In 2020, E. Supriyadi [41] used LSTM to forecast weather parameters, including temperature. The LSTM was trained using air temperature data from January 2019 and tested with data from February 2019. The results showed that LSTM could produce temperature predictions with a lower RMSE after updating the model, achieving 0.576. In this case, LSTM was effective in predicting sinusoidal temperature patterns ranging from 23.8 to 34.4 °C. However, there was an increase in RMSE over time, indicating that prediction accuracy declined for longer periods.
Moreover, in the following year (2021), researchers such as H.-M. Choi et al. [36] highlighted the use of LSTM models to predict abnormally high water temperatures on the southern coast of Korea. The LSTM model proved very effective in capturing the long and complex temporal patterns of sea surface temperature (SST) data obtained from satellites over the past decade. In performance evaluation, the LSTM model achieved an R² value of 0.994, an RMSE of 0.412, and an MAPE of 1.865 for one-day-ahead water temperature predictions. In the same year, T. Toharudin et al. [42] used LSTM to predict daily maximum and minimum temperatures in Bandung, achieving RMSE values of 1.23 and 0.94, respectively. Subsequently, E. Haque et al. [47] attempted to compare temperature forecasting results using LSTM and GRU. The analysis showed that LSTM (RMSE 1.77) slightly outperformed GRU, especially in detecting long-term dependencies. However, robustness analysis indicated that GRU exhibited the best performance with the lowest average RMSE (2.0042°C) among the tested models, suggesting that GRU is the most robust DNN model for temperature data from different geographical locations. While the LSTM model did not perform as well as GRU, it still demonstrated competitive performance with an RMSE of 2.2768°C.
In 2022, F. Rasyid and D. A. Adytia [37] focused on testing the capabilities of several algorithms, including LSTM, for short-term temperature forecasting in Jakarta, Indonesia. The LSTM algorithm demonstrated the best performance in predicting temperatures for 1, 3, and 7 days ahead compared to ConvLSTM and MLP. This was evidenced by lower RMSE and MAE values of 0.3099 and 0.2443, respectively, and a higher Correlation Coefficient (CC) for LSTM [37]. In another study, D. Jansen et al. (2022) [39] discussed the application of the LSTM algorithm in predicting meteorological data in East Kalimantan, specifically for temperature variables. This study used data from three meteorological stations: Kalimarau, Sultan Aji Sulaiman Sepinggan, and Aji Pangeran Tumenggung Pranoto, covering the period from January 2010 to June 2022. D. Jansen et al. showed that LSTM could produce accurate temperature predictions based on this study. Two LSTM models with different configurations were tested, and both provided results that were not significantly different. The first model had three LSTM layers with 64, 64, and 32 units, while the second model used 128, 64, and 32 units. Evaluation using MAE, MSE, and RMSE metrics showed that the LSTM model could predict temperature well, with MAE, MSE, and RMSE values for temperature at Sultan Aji Sulaiman Sepinggan station being 0.67, 0.72, and 0.85 for the second model, which was slightly better than the first model with values of 0.68, 0.75, and 0.86 [39]. Y. E. N. Nugraha et al. [40] in their research discussed the use of the LSTM algorithm for temperature forecasting based on daily weather data collected from the Maritime Meteorological Station in Serang. LSTM was trained using weather data with a combination of various weather parameters and evaluated using RMSE metrics. The results showed that LSTM had the best performance in predicting temperature, with an RMSE value of 0.37.
Meanwhile, for GRU applied in 2023, there was a study by H. Darmawan et al. [43]. In this research, GRU was used to generate weather predictions, including minimum temperature, maximum temperature, and average temperature based on data obtained from the Meteorology Station (Class I, Juanda) in Sidoarjo Regency, Indonesia (between January 2000 and June 2021). This study produced fairly good RMSE values for all types of temperatures (Tx, Tn, and Tavg). However, when compared, the RMSE value for Tavg was better than Tx and Tn, at 0.44. Tx and Tn each obtained RMSE values of 0.5 and 0.52 [43]. In the same year, H. Subair et al. [45] successfully predicted minimum temperature with an RMSE value of 0.694 and MAE of 0.523°C. These results were quite good, although not as good as those obtained by H. Darmawan et al. In another study, M. Diqi et al. [44] achieved much better results, reaching RMSE levels of 0.0326, MAE of 0.0277, MAPE of 0.0482, and R² of 0.9097.
In 2024, A. Andre and T. Handhayani [38] applied the LSTM algorithm to predict temperatures in Ternate, North Maluku. Using historical data from 2010 to 2023, LSTM successfully produced predictions for minimum, maximum, and average temperatures with RMSE values of 0.69, 1.02, and 0.67, respectively. In this case, the average temperature prediction was better compared to the minimum and maximum temperature predictions. A summary of the previous research reviewed in this study is shown in Table 1.
| Ref. | Year | Method | Research Objects |
Data Source | Accuracy | ||
|---|---|---|---|---|---|---|---|
| MSE | RMSE | MAE | |||||
| H.-M. Choi, et. al [36] | 2021 | LSTM | Water Temp | European Center for Medium-Range Weather Forecast (ECMWF) satellite-derived water temperature data from 2008 to 2017 | 0.1697 | 0.4120 | - |
| F. Rasyid and D. A. Adytia [37] | 2022 | LSTM | Temp | ERA-5 dataset (2018-2021) in Jakarta, Indonesia | 0.0960 | 0.3099 | 0.2443 |
| A. Andre and T. Handhayani [38] | 2024 | LSTM | Tn |
Data from BMKG, period January 2010 – August 2023, Temperature prediction in Ternate, North
Maluku |
0.4700 | 0.6900 | 0.5300 |
| 2024 | LSTM | Tx | 1.0400 | 1.0200 | 0.7600 | ||
| 2024 | LSTM | Tavg | 0.4500 | 0.6700 | 0.5200 | ||
| D. Jansen, et. al [39] |
2023 | LSTM | Temp | Meteorological station Kalimarau (BMKG), period January 2010 – June 2022 | 0.8300 | 0.9100 | 0.7200 |
| 2023 | LSTM | Temp | Meteorological station Sultan Aji Sulaiman Sepinggan (BMKG), period January 2010 – June 2022 | 0.7200 | 0.8500 | 0.6700 | |
| 2023 | LSTM | Temp | Meteorological station Aji Pangeran Tumenggung Pranoto (BMKG), period January 2010 – June 2022 | 1.4100 | 1.1900 | 0.9200 | |
| Y. E. N. Nugraha, et. al [40] | 2023 | LSTM | Temp | Daily data from January 1, 2018, to October 28, 2022, provided by BMKG and measured by the Maritime Meteorological Station Serang | 0.1369 | 0.3700 | - |
| E. Supriyadi [41] | 2020 | LSTM | Temp | Data from BMKG measured by the Maritime Meteorological Station Tanjung Priok | 0.3318 | 0.576 | - |
| T. Toharudin, et. al [42] | 2021 | LSTM | Tx | Historical data of daily maximum and minimum air temperatures in Bandung from January 1st, 2014 to June 30th, 2019 | 1.5129 | 1.2300 | - |
| 2021 | LSTM | Tn | 0.8836 | 0.9400 | - | ||
| H H. Darmawan, et. al [43] | 2023 | GRU | Tx |
BMKG Meteorology Station (Class I, Juanda) in Sidoarjo Regency, Indonesia (between January 2000 and June
2021) |
0.2500 | 0.500 | - |
| 2023 | GRU | Tn | 0.2704 | 0.5200 | - | ||
| 2023 | GRU | Tavg | 0.1936 | 0.4400 | - | ||
| eM. Diqi, et. al [44] | 2023 | GRU | Temp | Denpasar Weather Data (from Kaggle) | 0.0011 | 0.0326 | 0.0277 |
| H. Subair, et. al [45] | 2023 | GRU | Tn | Agro Climate Research Centre, TNAU, Coimbatore, Tamil Nadu, India (data from January 1982 to September 2022) | 0.4816 | 0.6940 | 0.5230 |
| J. Anjani, et. al [46] | 2024 | LSTM | Temp | Air temperature prediction on Runway 10 at Juanda Airport (Automatic Weather Observing System (AWOS)) | 0.0182 | 0.1349 | 0.0810 |
| 2024 | GRU | Temp | 0.0182 | 0.1349 | 0.0810 | ||
| E. Haque, et. al [47] | 2021 | LSTM | Temp | Zhang S. et al., “Cautionary Tales,” hourly temperature (2013-2017), Beijing, and Historical Hourly Weather Data, hourly temperature (2012-2017), Toronto, Seattle, Dallas, Las Vegas. | 5.1838 | 2.2768 | 1.5680 |
| 2021 | GRU | Temp | 4.0168 | 2.0042 | 1.5128 | ||
However, the RMSE difference between the minimum and average temperatures was minimal, at just 0.02 [38]. In the same year, J. Anjani et al. [46] contributed to research with their study titled “Prediction of Air Temperature on Runway 10 Juanda Airport Using Hybrid LSTM.” This study explored a combination of LSTM and GRU architectures to predict air temperature at Juanda Airport, East Java, Indonesia. The research aimed to address challenges in temperature forecasting influenced by extreme climate changes using deep learning methods. Interestingly, LSTM and GRU achieved identical RMSE and MAE values of 0.1349 and 0.081.
5.2.Comparative Analysis of Referenced Literature
A comparative analysis of existing literature is an important step to understand the developments, methodologies, and results achieved in a field of study. This analysis provides an overview of the strengths and weaknesses of various approaches taken by previous researchers, and identifies areas that still require further research. This analysis will compare the referenced literature based on the RMSE evaluation metrics achieved in previous studies. The RMSE achieved by each reviewed previous study is shown in Fig. 3.
Based on the RMSE values presented in Fig. 3, it is evident that both GRU and LSTM methods have been applied in various studies for temperature and related variable predictions. From the available data, GRU shows outstanding results with the lowest RMSE of 0.033, as reported by M. Diqi et al. (Temp) in 2023. This result indicates that GRU can produce highly accurate predictions in the context of temperature data, with minimal prediction error. LSTM also demonstrates excellent performance with competitive RMSE values, such as the study by J. Anjani et al. (Temp) in 2024, which reported an RMSE value of 0.135 for the LSTM model. Furthermore, similar results were also reported for GRU with an RMSE of 0.135 in the same study. This indicates that both models have very good predictive capabilities within the same data context. Other studies, such as the one conducted by H.-M. Choi et al. (Water Temp) in 2021, show that LSTM can be effectively used to predict water temperature with an RMSE value of 0.412. Although not as good as some GRU results, this value still demonstrates the strong performance of LSTM.
Results from H. Darmawan et al. (Tx) in 2023 show GRU with an RMSE of 0.5 and for Tavg with an RMSE of 0.44, indicating GRU's consistency in predicting maximum and average temperatures. The study by Y. E. N. Nugraha et al. (Temp) in 2023 reported LSTM with an RMSE of 0.37, consistent with other studies. F. Rasyid and D. A. Adytia (Temp) in 2022 reported an RMSE of 0.31, further confirming LSTM's strong predictive capability in the context of temperature. Although these results have not reached the levels achieved by M. Diqi et al. (Temp) with GRU in 2023. However, to view the comparison from another perspective and ensure that the dataset and parameters are the same, the RMSE comparison for researchers using both GRU and LSTM is shown in Fig. 4.
Based on Fig. 4, there are two studies that have used and compared both GRU and LSTM on the same dataset, namely the studies by J. Anjani et al. and E. Haque et al. In the study by J. Anjani et al., both the LSTM and GRU models produced identical RMSE values of 0.1349 (0.13). This indicates that both models have very good and almost equal predictive capabilities for the dataset used. On the other hand, the study by E. Haque et al. shows a difference in RMSE values between LSTM and GRU, with GRU achieving an RMSE of 2.0042 (2.00) while LSTM reached 2.2768 (2.28). This result suggests that GRU performed better compared to LSTM on that dataset. The disparity in RMSE values between these two studies may also indicate that model performance highly depends on the characteristics of the dataset used, with GRU potentially being superior in handling variations and uncertainties in temperature data in the study by E. Haque et al. However, in the study by J. Anjani et al., both LSTM and GRU provided almost equal performance, underscoring the flexibility and robustness of both models in temperature prediction applications.
Furthermore, when looking at the number of studies for each method by year, LSTM appears to be more popular compared to GRU. As shown in Fig. 5, there were no studies using GRU for temperature prediction in 2020 and 2022, while LSTM had one study each year. In 2021, 2023, and 2024, LSTM had 4 studies, while GRU had 1, 5, and 1 studies respectively in those years. Although 2023 shows a higher number of GRU studies compared to LSTM, when calculated overall, the use of LSTM still exceeds that of GRU.
On the other hand, when averaged by year and method, GRU shows a consistently improving average RMSE. Recorded at an average of 2.00 in 2021, 0.44 in 2023, and a lower average of 0.13 in 2024. Meanwhile, LSTM has a higher and almost inconsistent average each year. The best average RMSE for LSTM was recorded in 2022 at 0.31. However, 2021 recorded the highest error values for both methods, with LSTM at 1.21 and GRU at 2.00, as shown in Fig. 6. Additionally, when examining the minimum, average, and maximum values for each method across all referenced literature, GRU consistently demonstrates better performance. GRU has a minimum RMSE of 0.03, an average RMSE of 0.62, and a maximum RMSE of 2.00. These values are better compared to LSTM, which has a minimum RMSE of 0.13, an average RMSE of 0.83, and a maximum RMSE of 2.28. This is illustrated in Fig. 7.
The analysis results indicate that both GRU and LSTM are effective methods for temperature prediction, with GRU generally showing a slight advantage in error values and consistency across several studies. However, on the other hand, LSTM seems to have been more favored and implemented by researchers in recent years for temperature forecasting case studies.
5.3.Advantages and Disadvantages of LSTM and GRU Methods
LSTM has the ability to capture complex patterns in time series data, such as daily temperature fluctuations influenced by solar radiation [41]. Its main advantage is its capability to remember information over long time periods, which is crucial for predicting natural phenomena like fluctuating water temperatures [36]. LSTM effectively addresses the vanishing gradient problem often encountered in conventional recurrent RNNs. Additionally, LSTM can handle complex and noisy time series data, providing better prediction results compared to other traditional methods [38]. Another strength of LSTM is its ability to manage large volumes of data and high complexity, maintaining long-term information necessary for accurate predictions [39]. However, LSTM has some drawbacks, including a decline in prediction accuracy over time and less suitability for highly fluctuating weather data like wind speed (multivariate) [41]. It also requires large, clean datasets (without missing values) and high computational time [36], [41], necessitating appropriate imputation techniques for missing values to ensure proper model training. Although LSTM is designed to handle long-term time series, it still shows a decrease in accuracy as the prediction period extends [36]. LSTM also has longer training times and demands more computational resources compared to GRU algorithms [47].
On the other hand, GRU has advantages in training speed and memory efficiency, making it faster and lighter than LSTM [42], [45]. GRU's main advantage is its ability to handle time series data with complex non-linear fluctuations [45]. It uses mechanisms like update gates and reset gates, allowing the model to selectively update and forget information, thus capturing relevant patterns in the input data [44]. In temperature prediction cases, GRU also handles long-term dependencies effectively, useful in forecasting temperatures where seasonal patterns and long-term trends influence the data [44], [47]. However, GRU may not be as accurate as LSTM for very long sequence data and is less flexible in handling extremely long memory spans [45]. Challenges such as overfitting and computational complexity remain concerns, especially when the model is applied to data with high variability [44]. Additionally, GRU might require more careful hyperparameter tuning to achieve optimal performance [43]. Although GRU has the advantage in training speed, it may not provide prediction accuracy as high as LSTM, particularly for data with long-term time dependencies [47]. It is advisable to consider the dataset characteristics first to ensure that the chosen method and dataset work well together to produce accurate and reliable forecasts.
5.4.Gaps in the Referenced Literature
Previous research on temperature prediction using LSTM and GRU highlights several gaps that need to be addressed to improve forecasting performance. One major gap is the inability of LSTM to maintain long-term temperature prediction accuracy and handle highly fluctuating weather data. LSTM also requires large, clean datasets and has high computational time [41]. Additionally, there is a lack of exploration in utilizing additional features such as humidity, air pressure, and other meteorological data, which can provide more context in temperature prediction [36], [37], [40], [43], [46]. This approach can be referred to as Multivariate LSTM. While GRU performs well in handling time series data with complex non-linear fluctuations and has advantages in training speed and memory efficiency, it may not be as accurate as LSTM for very long sequence data and sometimes does not achieve the same level of prediction accuracy as LSTM [42], [45]. GRU also struggles in predicting variables with high fluctuations and volatility [44].
Several studies indicate the need for further exploration of hyperparameter optimization and different model architectures to improve forecasting performance, such as adjusting the number of units per layer, the number of layers, and other training parameters like learning rate and batch size. Some studies only compare models with relatively simple configurations [39]. Combining LSTM with other models like GRU or even non-neural models like ARIMA, and using ensemble techniques, might enhance prediction accuracy and robustness [38], [41], [42]. Other gaps include the lack of model evaluation in the context of more varied or extreme data, and limitations in handling very complex seasonal patterns without additional features or more in-depth data preprocessing [45], [47]. Future research can focus on developing models that better handle highly volatile variables and consider external factors in the model training process [43]. Further adjustments to hyperparameters and experiments with more complex model architectures like Transformers also have the potential to yield more accurate results [38], [39], [46].
5.5.Future Improvement Potential
Future research can optimize LSTM and GRU for temperature prediction through various innovative approaches that enhance accuracy and efficiency. Integrating additional environmental variables such as humidity, wind speed, and precipitation can help models capture complex weather dynamics [38], [45]. Utilizing satellite and sensor data like GOCI, GOCI-II, and Himawari can improve short-term prediction accuracy by providing high-resolution data on diurnal changes [36], as the accuracy of the data source greatly affects deep learning model performance.
Hybrid algorithm approaches are also promising. Combining LSTM with other deep learning models like CNN can help capture more complex spatiotemporal patterns, while using Attention Mechanisms can improve focus on important information in time series data [37], [39]. Exploring hybrid models that combine LSTM with Prophet, XGBoost, Random Forest, or other machine learning algorithms can leverage the strengths of each, resulting in more robust predictions [37], [43]. For GRU, combining this architecture with CNN also has the potential to enhance the ability to capture spatiotemporal patterns [44]. Using ensemble techniques that combine GRU with Transformer can increase model resilience to wide temperature variations [45]. Additionally, integrating LSTM and GRU models within a single hybrid framework can leverage the strengths of both models to effectively handle data with long-term and short-term dependencies [47].
Other innovations include applying transfer learning to utilize models pre-trained on similar datasets, thereby improving prediction performance on smaller or less representative datasets [45]. Using more advanced pre-processing techniques, such as advanced normalization and data augmentation, can help models handle rare but significant extreme weather events [40], [44]. Developing ensemble algorithms that combine LSTM and GRU with ARIMA or other statistical methods can also effectively capture both short-term and long-term patterns [38], [40].
Implementing Internet of Things (IoT) technology for real-time data collection can dynamically update prediction models, enabling quicker responses to extreme weather changes [38], [103], [104]. By combining these approaches, temperature prediction models are expected to contribute more significantly to various sectors such as agriculture, transportation, and disaster management, with higher accuracy and faster responses to changing weather conditions [46], [105].
6.Conclusion
In the field of temperature prediction modeling, both LSTM and GRU methods demonstrate significant effectiveness in handling time series data and modeling complex seasonal patterns or trends. LSTM, with RMSE values ranging from 0.37 to 2.28, is often the preferred choice due to its ability to capture long-term patterns and temperature dynamics, although its performance may decline over time or with certain datasets. On the other hand, GRU shows greater consistency and better performance in terms of RMSE values, with results ranging from 0.03 to 2.00. Comparative analysis reveals that while LSTM remains popular with good RMSE values, GRU often provides advantages in prediction accuracy and error consistency, with a lower and more stable average RMSE compared to LSTM.
Author Contribution: All authors contributed equally to the main contributor to this paper. All authors read and approved the final paper.
Funding: This research is supported by Penelitian Disertasi Doktor (PDD), Universitas Sebelas Maret, Number: 194.2/UN27.22/PT.01.03/2024.
Acknowledgment: The author would like to thank to Universitas Sebelas Marer for research supported funding.
Conflicts of Interest: The authors declare no conflict of interest.
References
Original publication: International Journal of Robotics and Control Systems. Copyright © 2024 The Authors. CC BY-SA 4.0. This reading version reformats the supplied article for browser presentation and converts TeX equations to MathML.
Publication information
Published: 2024-09-05