Rainfall Prediction Using Attention-Based LSTM Architecture

Authors

  • Ahmad Romadhani Universitas Islam Negeri Maulana Malik Ibrahim Malang
  • Irwan Budi Santoso Universitas Islam Negeri Maulana Malik Ibrahim Malang
  • Cahyo Crysdian Universitas Islam Negeri Maulana Malik Ibrahim Malang

DOI:

https://doi.org/10.30865/jurikom.v12i3.8727

Keywords:

Rainfall Prediction, Long Short-Term Memory (LSTM), Attention Mechanism, Deep Learning, Malang Regency.

Abstract

This study addresses the challenge of accurately predicting rainfall in regions with complex climate dynamics, such as Malang Regency, East Java. It evaluates the performance of a Long Short-Term Memory (LSTM) model enhanced with the Bahdanau Attention Mechanism, comparing it with a Standard LSTM model in forecasting daily rainfall based on historical weather parameters including average temperature, relative humidity, sunshine duration, and wind speed. Using daily data from BMKG covering 2000 to 2023, both models underwent a structured machine learning process including data preprocessing, feature selection, model training, and evaluation. The Attention-Based LSTM consistently outperformed the Standard LSTM, particularly in handling rainfall anomalies, achieving an MSE of 0.00800 and RMSE of 0.08948, compared to 0.00817 and 0.09039 respectively for the Standard LSTM. These results demonstrate that integrating Bahdanau Attention improves the model’s focus on relevant temporal features, enhancing prediction accuracy and robustness. The architecture consisting of two LSTM cells combined with the attention mechanism effectively captures complex sequential patterns that the standard model tends to overlook. This research highlights the potential of attention mechanisms in time series weather prediction, contributing to more reliable early warning systems, adaptive agricultural strategies, and disaster risk reduction frameworks. Future work could explore hybrid models or incorporate additional weather features to further improve performance and generalization.

References

R. Fredyan and G. P. Kusuma, “Spatiotemporal convolutional LSTM with attention mechanism for monthly rainfall prediction,” Communications in Mathematical Biology and Neuroscience., vol. 2022. https://doi.org/10.28919/cmbn/7761.

Wayan, I., & Suranata, A. (2023). Development of Rainfall Prediction Model in Cities Denpasar Using LSTM and GRU Methods. Journal of Systems and Informatics., Vol. 18, no. 1 pp. 64-73, 2023. https://doi.org/10.30864/jsi.v18i1.603.

M. D. A. Carnegie and C. Chairani, “Comparison of Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) for rainfall prediction,” Journal of Media Informatics Budidarma, vol. 7, no. 3, pp. 1022–1030, 2023. https://doi.org/10.30865/mib.v7i3.6213.

M. Musfiroh, D. C. R. Novitasari, P. K. Intan, and G. G. Wisnawa, “Application of Principal Component Analysis (PCA) and Long Short-Term Memory (LSTM) methods in predicting daily rainfall,” Journal of Information and Science Technology., vol. 5, no. 1, 2023. https://doi.org/10.47065/bits.v5i1.3114.

N. Made, M. Candra, D. Agung, B. Kadek, and A. Wirdiani, “Rainfall prediction using Vanilla RNN and LSTM to determine the start of the rainy and dry seasons,” Journal of Education and Informatics, Vol 8, No 3, 2022. https://doi.org/10.26418/jp.v8i3.56606

R. F. Firdaus and I. V. Paputungan, “Rainfall prediction in Bandung city using Long Short-Term Memory method,” Journal of Innovative Technology, vol. 2, no. 3, pp. 453–460, 2022. https://doi.org/10.54082/jupin.99.

Y. Hendra, H. Mukhtar, and R. Hafsari, “Rainfall prediction in Pekanbaru city using LSTM (Long Short-Term Memory),” Journal of System Informatics, vol. 3, no. 2, pp. 74–81, 2023. https://ejurnal.umri.ac.id/index.php/SEIS/index.

J. Badriyah, A. Fariza, and T. Harsono, “Rainfall prediction using Long Short-Term Memory,” Journal of Media Informatics Budidarma, vol. 6, no. 3, pp. 1297–1302, 2022. https://doi.org/10.30865/mib.v6i3.4008.

Han, D., Liu, P., Xie, K., Li, H., Xia, Q., Cheng, Q., Wang, Y., Yang, Z., Zhang, Y., & Xia, J. (2023). An attention-based LSTM model for long-term runoff forecasting and factor recognition. Environmental Research Letters, 18(2). https://doi.org/10.1088/1748-9326/acaedd.

Li, W., Zhang, P., Dong, H., Jia, Y., & Cao, W. (2021). RSDF-AM-LSTM: Regional Scale Division Rainfall Forecasting Using Attention and LSTM. ACM/IMS Transactions on Data Science, 2(4), 1–27. https://doi.org/10.1145/3498333.

Nayak, G. H. H., Varalakshmi, A., Manjunath, M. G., Veershetty, Avinash, G., & Baishya, M. (2023). Trend Analysis and Prediction of Rainfall Using Deep Learning Models in Three Sub-Divisions of Karnataka. Journal of Experimental Agriculture International, 45(4), 36–48. https://doi.org/10.9734/jeai/2023/v45i42114.

Buathongkhue, C., Sureeya, K., & Kaewthong, N. (2024). Analysis and Prediction of Rainfall with Oceanic Nino Index and Climate Variables Using Correlation Coefficient and Deep Learning. Civil Engineering Journal (Iran), 10(5), 1354–1369. https://doi.org/10.28991/CEJ-2024-010-05-01.

Van Houdt, G., Mosquera, C., & Nápoles, G. (2020). A review on the long short-term memory model. Artificial Intelligence Review, 53(8), 5929–5955. https://doi.org/10.1007/s10462-020-09838-1.

Maknunah, J., As, M., Setyowibowo, S., Farida, E., & Dwi Mumpuni, I. (2022). Indonesian consumer price index (CPI) forecasting using an exponential smoothing-state space model Technology of Information, STMIK PPKIA Pradnya-Paramita. Business and Accounting Research (IJEBAR) Peer Reviewed-International Journal, 8. https://jurnal.stie-aas.ac.id/index.php/IJEBAR.

Muttaqien, F. H., Syafarina, I., Wahyuni, I. N., & Latifah, A. L. (2022). Time-Series Model for Climatological Forest Fire Prediction over Borneo. Lontar Komputer: Scientific Journal of Information Technology, 13(1), 35. https://doi.org/10.24843/lkjiti.2022.v13.i01.p04.

D. C. Y?ld?r?m, I. H. Toroslu, and U. Fiore, “Forecasting directional movement of Forex data using LSTM with technical and macroeconomic indicators,” Financial Innovation, vol. 7, no. 1, p. 1, Dec. 2021, doi: 10.1186/s40854-020-00220-2.

M. Agrawal, P. Kumar Shukla, R. Nair, A. Nayyar, and M. Masud, “Stock Prediction Based on Technical Indicators Using Deep Learning Model,” Computers, Materials & Continua, vol. 70, no. 1, pp. 287–304, 2022, doi: 10.32604/cmc.2022.014637.

T. Fischer and C. Krauss, “Deep learning with long short-term memory networks for financial market predictions,” Eur J Oper Res, vol. 270, no. 2, pp. 654–669, Oct. 2018, doi: 10.1016/j.ejor.2017.11.054.

Z. Cipiloglu Yildiz and S. B. Yildiz, “A portfolio construction framework using LSTM ?based stock markets forecasting,” International Journal of Finance & Economics, vol. 27, no. 2, pp. 2356–2366, Apr. 2022, doi: 10.1002/ijfe.2277.

Y. Gao, R. Wang, and E. Zhou, “Stock Prediction Based on Optimized LSTM and GRU Models,” Sci Program, vol. 2021, pp. 1–8, Sep. 2021, doi: 10.1155/2021/4055281.

A. Chaweewanchon and R. Chaysiri, “Markowitz Mean-Variance Portfolio Optimization with Predictive Stock Selection Using Machine Learning,” International Journal of Financial Studies, vol. 10, no. 3, p. 64, Aug. 2022, doi: 10.3390/ijfs10030064.

F. Liu and C. Liang, “Short-term power load forecasting based on AC-BiLSTM model,” Energy Reports, vol. 11, pp. 1570–1579, Jun. 2024, doi: 10.1016/j.egyr.2024.01.026.

D. Chicco, M. J. Warrens, and G. Jurman, “The coefficient of determination R-squared is more informative than SMAPE, MAE, MAPE, MSE and RMSE in regression analysis evaluation,” PeerJ Comput Sci, vol. 7, p. e623, Jul. 2021, doi: 10.7717/peerj-cs.623.

W. Lefebvre, G. Loeper, and H. Pham, “Mean-Variance Portfolio Selection with Tracking Error Penalization,” Mathematics, vol. 8, no. 11, p. 1915, Nov. 2020, doi: 10.3390/math8111915.

M. Sikalo, A. Arnaut-Berilo, and A. Zaimovic, “Efficient Asset Allocation: Application of Game Theory-Based Model for Superior Performance,” International Journal of Financial Studies, vol. 10, no. 1, p. 20, Mar. 2022, doi: 10.3390/ijfs10010020.

C. Bergström and O. Hjelm, “Impact of Time Steps on Stock Market Prediction with LSTM,” KTH Royal Institute of Technology, Stockholm, 2019.

F. D. Paiva, R. T. N. Cardoso, G. P. Hanaoka, and W. M. Duarte, “Decision-making for financial trading: A fusion approach of machine learning and portfolio selection,” Expert Syst Appl, vol. 115, pp. 635–655, Jan. 2019, doi: 10.1016/j.eswa.2018.08.003.

Additional Files

Published

2025-06-30

How to Cite

Romadhani, A., Santoso, I. B., & Crysdian, C. (2025). Rainfall Prediction Using Attention-Based LSTM Architecture. JURNAL RISET KOMPUTER (JURIKOM), 12(3), 329–340. https://doi.org/10.30865/jurikom.v12i3.8727

Issue

Section

Articles